Results 1 to 2 of 2

Thread: Problems / Core / ASCIIZ initialization

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Problems / Core / ASCIIZ initialization

    Hi Eros,

    I found a problem in core or parsing.
    Try following:
    [code=thinbasic]
    uses "Console"

    local a AS ASCIIZ * 256 = "Ciao"
    local b AS ASCIIZ * 256 value "Ciao"

    PRINTL "A =", a
    PRINTL "B =", b
    waitkey
    [/code]
    For a I get nothing, for b I get correct value. So it seems VALUE is not the same as equal sign in this case.


    Thanks,
    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

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

    Re: Problems / Core / ASCIIZ initialization

    I think that problem is related to every fixed string.
    Parser try to compute 256 = "Ciao" as a numeric statement resulting in logical expression always evaluating to %FALSE so zero.

    I'm trying to get a way to avoid this behave.

    Thanks for finding it.
    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. For discussion: simplified UDT / array of UDT initialization.
    By Petr Schreiber in forum thinBasic General
    Replies: 10
    Last Post: 22-08-2011, 04:41

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
  •