You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Hi Mike
Another way to skin the cat is (your code modified)
Code:
#COMPILE EXE
#DIM ALL
#REGISTER NONE
TYPE test
l AS LONG
sPtr AS DWORD
END TYPE
FUNCTION PBMAIN()
DIM t AS TEST, A$
DIM x AS ASCIIZ PTR
t.l = 2
A$ = "TEST"
t.sPtr = STRPTR(A$)
x = t.sPtr
MSGBOX @x
END FUNCTION
I've used this in the past where I wanted a scratch UDT that could be used differently in
different procedures.
Hi, I was under the impression that the following would work, but i get a page fault every time i run it.
Code:
#COMPILE EXE
#DIM ALL
#REGISTER NONE
TYPE test
l AS LONG
sPtr AS STRING PTR
END TYPE
FUNCTION PBMAIN()
DIM t AS TEST
t.l = 2
[email protected] = "Test"
END FUNCTION
Is there no way to use variable length strings in a UDT?
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: