Removed: ASCII mode -- What dooes that mean??

Just starting out? Need help? Post your questions and find answers here.
User avatar
idle
Always Here
Always Here
Posts: 6168
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Removed: ASCII mode -- What dooes that mean??

Post 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.
Randy Walker
Addict
Addict
Posts: 1203
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA
Contact:

Re: Removed: ASCII mode -- What dooes that mean??

Post 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.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
User avatar
idle
Always Here
Always Here
Posts: 6168
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Removed: ASCII mode -- What dooes that mean??

Post 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.
User avatar
mk-soft
Always Here
Always Here
Posts: 6512
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Removed: ASCII mode -- What dooes that mean??

Post 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.
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
Randy Walker
Addict
Addict
Posts: 1203
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA
Contact:

Re: Removed: ASCII mode -- What dooes that mean??

Post 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
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
User avatar
idle
Always Here
Always Here
Posts: 6168
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Removed: ASCII mode -- What dooes that mean??

Post by idle »

you can't use sizeof() on a variable
User avatar
spikey
Enthusiast
Enthusiast
Posts: 795
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: Removed: ASCII mode -- What dooes that mean??

Post 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.
Post Reply