Heaventools

   English English  Deutsch Deutsch  Русский Русский
Heaventools Support Forums
May 17, 2012, 03:07:43 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: What is a Long Pascal String?  (Read 3100 times)
0 Members and 2 Guests are viewing this topic.
deleyd
New Member
*
Posts: 7

Location:
Santa Barbara, CA

Offline Offline



« on: August 19, 2006, 06:27:17 pm »

So far I have:

ZStr = zero terminated string (ASCIIZ, used in C).

PStr (Pascal String) = I'm guessing the first character is the length byte, followed by the string. Is this correct?

What is a Long Pascal String(LPStr)? I'm guessing the first word, or double word, is the length of the string? Which is it?

And is the format for a Unicode string(UCStr) that it always starts with hex byte DB, followed by words (16 bits) which represent the characters, ending with a zero word?
TechMan
Heaventools
Support
***
Posts: 220

Location:
On Air

Offline Offline



« Reply #1 on: August 20, 2006, 02:55:25 pm »

QUOTE
PStr (Pascal String) = I'm guessing the first character is the length byte, followed by the string. Is this correct?

Yes, a sequence of characters with a length byte at the beginning, indicating the size of the string. Sometimes null-terminated (00h).

QUOTE
What is a Long Pascal String(LPStr)? I'm guessing the first word, or double word, is the length of the string? Which is it?

This is for 32-bit versions of Borland Delphi/Builder.
The first double word is a reference counter (keeps track of how many string variables are referring to the same string in memory). Is always set to $FFFFFFFF (-1) in the code. I think it's in order for the memory manager not to try freeing this string since it's hardcoded.

The next double word is the length of the string. Then a sequence of characters followed by zero (00h).

QUOTE
And is the format for a Unicode string(UCStr) that it always starts with hex byte DB, followed by words (16 bits) which represent the characters, ending with a zero word?

Not available yet, but we plan to have it added in version 2.

TechMan Robot
Heaventools Software
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC