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 Professional Discussion / I cant believe this

Author
Message
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 22nd Jun 2003 01:10
this should say 3
it says 0

Lines$="BOO"
len(Lines$)=top#
print "",top#
Reset
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 22nd Jun 2003 01:11
soz
ignore that
just make top# the subject of the equation

Reset
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 22nd Jun 2003 02:49
Eh ?

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 22nd Jun 2003 02:52
I'm tempted to say "well duh!", but I'll resist.

All programming languages work on the basis of values on the right hand side being assigned to variables on the left hand side.

Do you want Windows menus in your DBP apps? - Get my plugin: http://snow.prohosting.com/~clone99/downloads/tpc_menus_103.zip
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 22nd Jun 2003 02:54
And you can understand what he said !?

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 22nd Jun 2003 02:58
Yeah. You have to remember that "len(Lines$)=top#" is not an equation when used in programming. It's an assignment statement, and there is a big difference. "=" does not mean equals in this case. It means assign the value on the right hand side to the variable on the left.

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)
adr
23
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 22nd Jun 2003 03:01
I don't think I've ever come across a language which has right hand side assignation... I dunno, probably Prolog or some crazy shit.

Quote: "
this should say 3
it says 0

Lines$="BOO"
len(Lines$)=top#
print "",top
"


try this instead:


disclaimer - never actually tried to compile my suggested code
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 22nd Jun 2003 03:43
Well, for a bit of trivia. VB allows you pass data into functions by assignment.

i.e. is legal and a very useful feature.



l8r,
Kevin Picone
[url]www.underwaredesign.com[/url]
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Jun 2003 04:04
It's also possible to do it using C++, or any other language that allows you to substitute your own assignment operator ... although because it's not the expected way of doing things, the code could get awfully unreadable fast.
haXor
23
Years of Service
User Offline
Joined: 12th May 2003
Location: United States
Posted: 22nd Jun 2003 04:15
........

Sup Kids
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 22nd Jun 2003 04:25 Edited at: 22nd Jun 2003 04:26
Actually, BASIC on the TI calculators uses "->" (one character) to store instead of "=" to define variables.

So, to do "a = 5", you would do "5 -> a"

I get mixed up alot.

"All programmers are playwrites and all computers are lousy actors" -Anon
Click Here!!!

Login to post a reply

Server time is: 2026-07-11 14:56:16
Your offset time is: 2026-07-11 14:56:16