Main Menu

The pound symbol

Started by Lonewolf10, 01 Jan, 2017, 09:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lonewolf10


Hi folks,

I was trying to debug something in AMOS Pro today, and whilst in the direct editor instead of typing...

? $12c

I typed this...

? £12c

... which didn't give me an error. Instead it printed out a number. I have since tried printing various numbers with the pound symbol and can't seem to fathom out what it does.

Searching the internet (with Google) hasn't helped me find the answer. Does anyone here know what the pound sign (£) does?

Mia

#1
wow you have found :o a special one.

it's magic!

- I did some tests then worked it out.

it becomes a variable and returns a value.

£123
_123

are both valid variable names!

lol!


Volvo_0ne

Yep!

It appears you can also use £ as first char of  a procedure definition name too

eg Procedure $MYPROC

VERY useful for distinguishing variables from Proc names :)

Not sure if it compiles yet though (not tried so far)

\/1
Transuranic heavy elements may not be used where there is life.

Lonewolf10


Ahh, thanks for that Mia and Volvo_One

I was aware of the underscore (I use it all the time in variable names) as I'm pretty sure that is mentioned in the AMOS Pro manual.
The pound symbol is a new one to me, despite coding in AMOS (on and off) for over 15 years now! :D

bruceuncle

AMOS uses the following rules for names:
Can't start with a digit.
'0' thru '9', 'A' thru 'Z' and 'a' thru 'z', '_' are all legal after that but note all upper case letters are stored as lower case (AMOS displays as upper case - but that can be changed in the editor's config file).
Then comes the interesting bit - any ASCII character from Chr$($81) thru Chr$($FF) is also legal.  Presumably to allow international characters to be used.
As this range also includes a few other symbols, the results can be quite hilarious.  Try checking out the characters you can type with the [Alt] key held down and you'll see what I mean.
Personal favourite is to be able to type "1/4=1" where the "1/4" is the symbol character.  One can make almost unreadable code this way but I wouldn't recommend it!

Sent from my Lumia 640 using Tapatalk
Repeat after me ...  "The AMOS Pro architecture is complex but it is not complicated."