Results 1 to 2 of 2

Thread: GUID (not a real type)

  1. #1

    GUID (not a real type)

    Here's some code:
    Function aba(nme As Guid)As String  
    Return "hello world"
    End Function
    Dim qqq As Guid  
    MsgBox 0 , aba(qqq)
    
    Line 5 throws a runtime error: "Missing Close Parens", "Token found: ABA". That happens even if the function takes its only parameter by reference instead of by value.
    If I replace every occurrence of "guid" in the code with, say, "quad", it works flawlessly.
    I suppose that that is intended behavior, as per the thinBasic Help Manual on the topic of GUID (language->data types->GUID):
    The GUID variable is typically used only as a parameter, rather than as a term in an expression.
    However, a priori it was not obvious that the quote meant that GUID was not an accepted type for arguments. This has caused me some lossage. To prevent inflicting further lossage on any more unsuspecting users, I suggest changing the documentation to be more explicit about this issue.

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Hi Vandalf,

    sorry for the inconvenience.
    In reality your code was supposed to work but there must be a parsing error in passing GUID data type to sub/functions.
    I will have a look.

    In the meantime, if you need to pass a GUID to a sub/function, please use a String parameter like the following. thinBasic will take care of internal conversions:
    Function aba(nme As string) As String
       Return "hello world: " & GUIDTXT$(nme)
    End Function
    
    Dim qqq As Guid = Guid$
    MsgBox 0 , aba(qqq)
    
    Thanks for reporting.
    Eros
    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. Activision real time character
    By ErosOlmi in forum Technology
    Replies: 1
    Last Post: 15-04-2013, 10:27
  2. Simple formula to simulate complex real life situations
    By marcuslee in forum thinBasic General
    Replies: 13
    Last Post: 11-11-2010, 09:14
  3. Example: Section 8.4 (page 281), The Real 3 Body Problem
    By Michael Clease in forum ThinBASIC programming in OpenGL/TBGL
    Replies: 2
    Last Post: 27-02-2010, 05:47
  4. MovieFX: Combining real and virtual, part 1
    By Petr Schreiber in forum TBGL Tutorials
    Replies: 17
    Last Post: 09-10-2009, 12:41
  5. Checkout Firefox 3.5, it became real fast
    By Michael Hartlef in forum Shout Box Area
    Replies: 2
    Last Post: 14-07-2009, 10:50

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
  •