PDA

View Full Version : Can An Alias Contain Spaces



peralta_mike
11-05-2011, 16:18
Can an alias contain spaces?

For example, I want

DEF FN to be an alias for FUNCTION.

Will this work or will the thinbasic parser
have problems with this?

- Mike

Petr Schreiber
11-05-2011, 16:48
Hi Mike,

I think the following rules apply for alias (as they do for variables/function names/...:


Must begin with an alphabetic character
Cannot contain embedded period, space and, in general, punctuation.

I think the problem with spaces is that similar situations could occur (extreme case):


ALIAS BEEP AS make that sound
ALIAS DIM AS make
ALIAS LONG AS that
ALIAS DWORD AS sound

make that sound ' -- What to do now? Is the first make alone, or should it all be recognised as one make that sound token?


So you will need to use:

ALIAS FUNCTION AS DEF_FN


Petr

Michael Clease
11-05-2011, 17:44
Alias Call As DEF

DEF FN

Function FN()
MsgBox 0, "Test"
End Function

peralta_mike
11-05-2011, 18:29
Hello Petr and Michael,

Thanks for the info.

It's not a problem. I am just trying to make our thinbasic script coding as
close to RMB basic (HP/Agilent's old basic language) as close as I can through
aliases and other current thinbasic features.

These are not show stoppers for me. I will just have to include all the porting notes
so that our thinbasic programming users know about all these details. It's not a big deal as the full list of RMB keywords and functions can all be documented in about 6 pages. So a few variations from the RMB language will be ok.

- Mike

btw I work for Medtronic http://www.medtronic.com
We make pacemakers, nuerostimulators(devices to treat parkinsons), internal drug pumps, etc. So you all may be happy to learn that thinbasic is now being used in the effort to save lives and to improve the quality of life for many patients worldwide.

ErosOlmi
11-05-2011, 21:24
Mike

thanks a lot for what you are doing with thinBasic
I will check this ALIAS option that seems quite intriguing but I cannot promise something in short time.

Medtronic? wow, it scare me but I'm very happy!

My cousin is a manager in Sorin Group an previously in Abbot and Edwards Lifesciences selling cardiac valves.