04-14-2005, 10:19 AM
I have a user-defined type whose first element is a string.
I've got a pointer to this type somewhere in my code, and I can set values by doing the standard stuff:
But, I can't set the string. It crashes the compiled program. E.g.,
kills it. (Yes, strName is a string.) Also, strName is an argument passed to a procedure. Something like...
If I comment out the string assignment statement, the code runs as expected, and normal results are produced (the values other than the string are being stored correctly and whatnot.)
v1c, any ideas here? Must be something I missed :-)
Code:
type myType
itemName as string
itemType as integer
...
end type
I've got a pointer to this type somewhere in my code, and I can set values by doing the standard stuff:
Code:
myThingy->itemType = 44
But, I can't set the string. It crashes the compiled program. E.g.,
Code:
myThingy->itemName = strName
kills it. (Yes, strName is a string.) Also, strName is an argument passed to a procedure. Something like...
Code:
function initializeThingy(strName as string, [and whatnot]) as myType pointer
dim temp as myType pointer
[allocate the memory]
temp->itemName = strName
[insert rest of function here]
end function
If I comment out the string assignment statement, the code runs as expected, and normal results are produced (the values other than the string are being stored correctly and whatnot.)
v1c, any ideas here? Must be something I missed :-)