Page 2 of 2
Re: Removed: ASCII mode -- What dooes that mean??
Posted: Tue Jan 20, 2026 3:40 am
by idle
if it compiles ok then your likely clobbering memory, compile with purifier compiler options -> Compile / run -> Enable Purifier then set a break point and you can then check the settings Debugger - > Purifier and Change String Variables every line. it might show where the problem is.
If your threaded, that's a little harder as you need to look prior to the crash to either the last allocate memory or dynamic string.
Re: Removed: ASCII mode -- What dooes that mean??
Posted: Tue Jan 20, 2026 5:05 am
by Randy Walker
idle wrote: Tue Jan 20, 2026 3:40 am
if it compiles ok then your likely clobbering memory, compile with purifier compiler options -> Compile / run -> Enable Purifier then set a break point and you can then check the settings Debugger - > Purifier and Change String Variables every line. it might show where the problem is.
If your threaded, that's a little harder as you need to look prior to the crash to either the last allocate memory or dynamic string.
I'm sorry. I'm not sure I follow you. Are you saying I can change variable values using profiler? Never used it because I don't understand it's purpose.
Re: Removed: ASCII mode -- What dooes that mean??
Posted: Tue Jan 20, 2026 6:52 am
by idle
Randy Walker wrote: Tue Jan 20, 2026 5:05 am
idle wrote: Tue Jan 20, 2026 3:40 am
if it compiles ok then your likely clobbering memory, compile with purifier compiler options -> Compile / run -> Enable Purifier then set a break point and you can then check the settings Debugger - > Purifier and Change String Variables every line. it might show where the problem is.
If your threaded, that's a little harder as you need to look prior to the crash to either the last allocate memory or dynamic string.
I'm sorry. I'm not sure I follow you. Are you saying I can change variable values using profiler? Never used it because I don't understand it's purpose.
Sorry for the confusion, "String Variables" is a setting in the purifier that checks string variables every 64 lines vs every line.
The purifier helps catch buffer overflows of memory and strings.
Re: Removed: ASCII mode -- What dooes that mean??
Posted: Tue Jan 20, 2026 11:43 am
by mk-soft
There are few points to consider to bring a program to version 6.xx.
- New Adjust PB functions
- If strings are processed with pointers: Address pointer calculation of constant 1 to SizeOf(Character)
- Previously for 32bit to 64bit: Adjust pointer as default variable from .l (LONG) to .i (INTEGER)
- Third API (DLL) check if it exists as Unicode. Otherwise create prototype with string as "p-ascii"
- Prepared Window API is automatically adjusted.
Re: Removed: ASCII mode -- What dooes that mean??
Posted: Tue Jan 20, 2026 6:35 pm
by Randy Walker
The more I look the less it makes any sense. The help gives this code snippet telling size will be 10 but when I run it I get 18 instead:
Code: Select all
Structure Person
Name.s
ForName.s
Age.w
EndStructure
Debug "The size of my friend is "+Str(SizeOf(Person))+" bytes" ; will be 10 (4+4+2)
John.Person\Name = "John"
Debug SizeOf(John) ; will be also 10
Re: Removed: ASCII mode -- What dooes that mean??
Posted: Tue Jan 20, 2026 7:49 pm
by idle
you can't use sizeof() on a variable
Re: Removed: ASCII mode -- What dooes that mean??
Posted: Tue Jan 20, 2026 8:15 pm
by spikey
Randy Walker wrote: Tue Jan 20, 2026 6:35 pm
The help gives this code snippet telling size will be 10 but when I run it I get 18 instead:
It's out of date, it was written for the 32-bit compiler where pointers are 4 bytes (32-bits). Pointers are 8 bytes on a 64-bit processor.
Are you looking at an old help file? It looks Ok to me in the current version:
Help 6.31 wrote:
Code: Select all
Debug "The size of my friend is "+Str(Sizeof(Person))+" bytes" ; will be 10 on 32-bit compiler as a string pointer is 4 bytes in memory
; will be 18 on 64-bit compiler as a string pointer is 8 bytes in memory
(Dynamic) strings don't get stored actually in a structure. The structure contains a pointer to a heap allocation location where the contents are stored.
So what the snippet is quoting is two 4 byte pointers + a 2 byte word and what you are seeing at runtime is two 8 byte pointers + a 2 byte word.