numeric string constants change type

Post bugs related to the IDE here
User avatar
HeX0R
Addict
Addict
Posts: 1197
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

numeric string constants change type

Post by HeX0R »

Probably not an IDE problem but a compiler problem?
I had to add a constant into compiler options -> constants, which was:
#TEST = "123"
But this seems to be swapped into #TEST = 123, because this here ends-up with a "Bad parameter type, string expected" error:

Code: Select all

Debug Len(#TEST)
User avatar
STARGÅTE
Addict
Addict
Posts: 2228
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: numeric string constants change type

Post by STARGÅTE »

Confirmed. All numeric like strings are converted to integer or float.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
blueb
Addict
Addict
Posts: 1115
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: numeric string constants change type

Post by blueb »

Hmm... that's odd? My debug returns 3
My system is very close to Stargate's.
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
HeX0R
Addict
Addict
Posts: 1197
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: numeric string constants change type

Post by HeX0R »

did you really follow the description?
add a constant into compiler options -> constants
User avatar
NicTheQuick
Addict
Addict
Posts: 1510
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: numeric string constants change type

Post by NicTheQuick »

Confirmed on Ubuntu Linux.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
Kiffi
Addict
Addict
Posts: 1491
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: numeric string constants change type

Post by Kiffi »

Confirmed. Mac Mini M4 (Sequoia)
Hygge
User avatar
blueb
Addict
Addict
Posts: 1115
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: numeric string constants change type

Post by blueb »

HeX0R wrote: Wed Aug 13, 2025 12:34 pm did you really follow the description?
add a constant into compiler options -> constants
Sorry... I missed that 'complier options' part. (even though you made it obvious) :(

Yes, I get the same results as you.
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
mk-soft
Always Here
Always Here
Posts: 6224
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: numeric string constants change type

Post by mk-soft »

If you use a letter or special character, it works.
#Test=#123
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Piero
Addict
Addict
Posts: 884
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: numeric string constants change type

Post by Piero »

Code: Select all

; #TEST = ~"123"
Debug #TEST ; Result: ~"123
:shock:
Post Reply