On 6 Jul 2001, at 8:08, Oldham, Adam wrote:
Hello people,
Again, I didn't see this in any FAQs or in the Bug List, so I am going to post the question. The Moveleft and Moveright functions should basically take a source and destination and copy the length number of bytes (from the left or right respectively), correct? That is how it worked with the old compiler I had, but I think we have come to the conclusion that it is horribly nonstandard, and since there are no help files on moveleft and moveright on the GPC page, I have to ask, and then ask if this is a bug.
My sample source is this: TYPE AnyStr = STRING[40]; AnyStrPtr = ^AnyStr;
VAR TestVar1 : AnyStrPtr; TestVar2 : AnyStrPtr; TestVar3 : AnyStr; TestVar4 : AnyStr;
BEGIN TestVar3 := 'TEST1'; TestVar1 := AnyStrPtr(@TestVar3); TestVar4 := 'TEST3'; TestVar2 := AnyStrPtr(@TestVar4); writeln(TestVar1^); writeln(TestVar2^); MOVELEFT (TestVar1^, TestVar2^, (LENGTH(TestVar1^) + 1)); writeln(""); writeln("After"); writeln(TestVar1^); writeln(TestVar2^); END. { unit pSos }
With GPC, the output is: TEST1 -> (TestVar1) TEST3 -> (TestVar2)
After TEST1 -> (TestVar1 after MoveLeft) TEST3 -> (TestVar2 after MoveLeft)
With my old compiler, the output is: TEST1 TEST3
After TEST1 TEST1
As it basically copies the length bytes of TestVar1 into TestVar2. Now, my question, does GPC work differently for this function, and if yes or no, is this a bug.
I am not sure that it is a bug. What you are assiging above is addresses. Then you "moveleft" values rather than addresses. I think that GPC's behaviour is correct here. If you move the addresses rather than the values, the result should be as you expected.
Best regards, The Chief --------- Prof. Abimbola Olowofoyeku (The African Chief) Author of Chief's Installer Pro for Win32 Email: African_Chief@bigfoot.com http://www.bigfoot.com/~african_chief/