Page 1 of 1

What distinguishes name$ from name.s ?

Posted: Tue Apr 29, 2003 7:22 pm
by ^OO^
Hi ^_^

I noticed that somebody had a problem resulting from a confusion of name.s with name$
They both seem to do the same thing in the same way - store a string.
So, why are there two forms of the same thing?
What distinguishes one from the other (apart from the name) ?
This might be important, after all ...

^@@^

Posted: Tue Apr 29, 2003 7:48 pm
by freak
The .s thing was there first. The $ was implemented because it is more
'basic' style. .s fits more with PB's type declaration, so I think it's good to
have them both.

If you use $, you always have to append the $ to the variable, which is
why I prefer the .s thing, because it saves me some typing :)
However some people prefer $ because this way they always see, which
one is a string variable and which is not.

Internally, they are both the same, you just can't mix them. Once you
define a string with $, you ALWAYS need to append it.

Timo

Posted: Tue Apr 29, 2003 8:09 pm
by ^OO^
Thanks, Freak.
So once you have defined say, num.l, you can go on using num ?

Code: Select all

Global floating.f, longnum.l, byte.b, name.s

; so I can use ...

  floating=14.0093
  longnum=39578566376
  bite=251
  name="Baron Frankenstein"

; for the rest of the program?
Cool

Posted: Tue Apr 29, 2003 8:21 pm
by Fred
Yes.

Posted: Tue Apr 29, 2003 9:17 pm
by GPI
btw.

Code: Select all

  name.s="hallo"
  name$="Bye"
  debug name
  debug name$
this work:

Code: Select all

  name$="Hallo"
  name=10
this not:

Code: Select all

  name.s="hallo"
  name=10
GPI

Posted: Tue Apr 29, 2003 9:46 pm
by ^OO^
Hi GPI

About ...

name.s="hallo"
name=10

was name originally name$ or name.s ?

Posted: Tue Apr 29, 2003 10:04 pm
by GPI
only this:
(see all example as new source-codes!)

Code: Select all

  name.s="hallo" 
  name=10 
What i want to say:
Name$
is not
Name.S / Name.W / Name.B / Name.l

There are two diffrent variables!

Posted: Wed Apr 30, 2003 12:45 am
by ^OO^
OK