Results 1 to 4 of 4

Thread: How to create a new "fake" data type?

  1. #1
    Junior Member
    Join Date
    Feb 2006
    Posts
    2
    Rep Power
    0

    How to create a new "fake" data type?

    I'm working on a library about stacks. Now, a "stack" variable is defined as a number, i.e.
    DIM stk AS DWORD
    
    stk = STACK_CREATE()
    STACK_PUSH(stk, "test content")
    ...and so on...
    
    How can I make possible to declare stk with a line like
    DIM stk AS STACK
    
    or, create an equate that may replace "STACK" with "DWORD", like in the C "typedef" directive? I've tried the equate-creating function thinBasic_AddEquate, but it doesn't work for data types.

    A small request, for third-party modules developers... what about a small guide about available functions and their use with C++ compilers?

    Thanks in advance

  2. #2

    How to create a new "fake" data type?

    Hi tbNewbie,

    you could try to use this code fragment:
    ALIAS DWORD AS STACK
    
    DIM stk AS STACK
    
    Please have a look at ALIAS help online:
    http://www.thinbasic.com/public/prod...html/alias.htm
    ALIAS keyword let you add new names that can be used to replace standard one.

    We are working on a complete SDK help that will explain SDK functions and functionalities.

    Also we are working on data structures. For the moment thinBasic manage numbers (many types) and strings (dynamic, asciiz and fixed-size). More complex data structures like TYPEs will come very soon.

    Keep in touch

    Thank you very much and best regards,
    Roberto
    http://www.thinbasic.com

  3. #3
    Junior Member
    Join Date
    Feb 2006
    Posts
    2
    Rep Power
    0

    How to create a new "fake" data type?

    Quote Originally Posted by RobertoBianchi
    Hi tbNewbie,

    you could try to use this code fragment:
    ALIAS DWORD AS STACK
    
    DIM stk AS STACK
    
    Please have a look at ALIAS help online:
    http://www.thinbasic.com/public/prod...html/alias.htm
    ALIAS keyword let you add new names that can be used to replace standard one.

    We are working on a complete SDK help that will explain SDK functions and functionalities.

    Also we are working on data structures. For the moment thinBasic manage numbers (many types) and strings (dynamic, asciiz and fixed-size). More complex data structures like TYPEs will come very soon.

    Keep in touch

    Thank you very much and best regards,
    Roberto
    Thank you for your *great* (and *very simple*!) idea. Then, if I create a file, say, "STACK.INC" containing the two lines

    USES "stack"
    ALIAS DWORD AS STACK
    
    and I include it in other files, I've solved the problem? So... I can create, for example, two new fake data types like "STACK" and "QUEUE" or so?

    A question in the question... When (ehm... if) I finish my small library for stacks and queues (containing strings), how can I upload it to you to include it in the 3rd party libraries list?

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

    How to create a new "fake" data type?

    Hi tbNewbie,

    your method is nice and will work. We are also adding a new function interface that will let you add a new alias directly from inside your DLL module so there will be no need to add the ALIAS in the script.

    Regarding your new module, please send a copy to me or Roberto via private message or via mail. We will check it and discuss with you. Possibly we will publish a new forum in wich you can be the moderator so you will have the option to talk with future users and update it. Is it ok?

    We will let you know when we will add new function interface.

    Regards
    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. Where is the actual data about the "M15 Format"?
    By ISAWHIM in forum M15 file format
    Replies: 3
    Last Post: 19-10-2008, 11:24

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
  •