Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Changing BASIC: Is It Possible?

Author
Message
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 30th Jun 2007 00:50
I love basic, but I don't like that variables don't have to be declared, is there a way to change this?
I would also prefer if assigning variables was more like other languages, using ":=" or "==".
If any of this is possible I'd be grateful for your suggestions.
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 30th Jun 2007 01:04 Edited at: 30th Jun 2007 01:04
Nope, not possible in dark basic
But if you use darkbasic long enough, you'll get used to it. I know I did

Don't look at my sig!
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Jun 2007 01:05
I see where you are coming from - as a Delphi/Pascal programmer with experience in C++ - but if you made those changes to BASIC, as good as they are, it would no longer be BASIC.

It's like saying you like French or German, but want to have a special version with lots of English words in it. It would then no longer be French or German if you did it!

You've always got Dark GDK if you prefer C++.

TDK_Man

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 30th Jun 2007 01:53
aww OK, I guess i wouldn't be able to post any of my code if I could change it anyway lol.
I guess I'll just have to make sure I spell my variable names correctly.
PS is there any way to check whether you've created a variable you didn't want to?
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Jun 2007 02:09
Not really.

You could always create Rem lines at the start of your program (where the global Var section would be). When you add variable names, you add the name to the 'Var' section on one of the Rem lines.

When you add it, you would be able to see if it's been used before, and being on Rem lines they would be totally ignored when compiled.

But, that sounds like a lot of unnecessary hard work to me!

TDK_Man

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 30th Jun 2007 03:02
@ TDK

yeah looks like hard work. I just get annoyed because on many occasions I've changed half of my code trying to find faults and it turned out to be a spelling mistake!!!
I spose i could use the "find" tool in darkEDIT and check it that way.
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 30th Jun 2007 09:44
Or make all of your globals arrays

int_a(0)
float_b#(0)
string_c$(0)

If it's spelled wrong later, DBC will complain.

Enjoy your day.
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 30th Jun 2007 17:28
@ Latch

Yeah that would work but it doesn't look too nice. I might use it if I'm writing a very big program. Thanks for the suggestion

I make music and art. Here is a sample of my art: done in Paint! It's all I have
[HOW DO I GET AN IMAGE IN HERE?]

Login to post a reply

Server time is: 2026-07-05 18:18:18
Your offset time is: 2026-07-05 18:18:18