[Vm-beginners] Return strings in numeric primitives
David T. Lewis
lewis at mail.msen.com
Tue Jul 3 03:43:40 UTC 2012
On Tue, Jul 03, 2012 at 12:04:40AM -0300, David Leonhardt wrote:
> Thank you all !!
>
>
> This is de code I made. It seems to work:
>
> primitiveHelloWorld
> | stringOop stringPtr size |
> <var: 'stringPtr' type: 'char*'>
> size := 11.
> stringOop := self instantiateClass: self classString indexableSize: size.
> stringPtr := self firstIndexableField: stringOop.
> 0 to: size-1 do:[ :i | stringPtr at: i put: ('Hello World' at: i) ].
> self pop:1 thenPush: stringOop.
>
> I had to use push, ^ not work at the same way.
>
> Best regards,
> David.
Well done, I think you have solved the puzzle :)
Dave
More information about the VM-beginners
mailing list