Results 1 to 5 of 5

Thread: Can An Alias Contain Spaces

  1. #1
    Member
    Join Date
    Jul 2010
    Location
    Phoenix, Arizona, usa
    Age
    74
    Posts
    54
    Rep Power
    19

    Can An Alias Contain Spaces

    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

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    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
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159
    Alias Call As DEF

    DEF FN

    Function FN()
    MsgBox 0, "Test"
    End Function
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  4. #4
    Member
    Join Date
    Jul 2010
    Location
    Phoenix, Arizona, usa
    Age
    74
    Posts
    54
    Rep Power
    19

    Thanks for the clarification.

    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.

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    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.
    Last edited by ErosOlmi; 12-05-2011 at 11:16.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Similar Threads

  1. fill spaces + reset
    By christianssen in forum thinBasic General
    Replies: 7
    Last Post: 16-03-2010, 09:47

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •