ASObjC: pointer to string object


(Phil Stokes) #1

I’d like to use this Objective-C method, but I don’t know how - or if - I can complete the final |type| parameter in ASObjC:

set w to aWorkspace's getFileSystemInfoForPath:"/" isRemovable:false isWritable:(missing value) isUnmountable:(missing value) |description|:(missing value) |type|:<????>

In pure objective-c, it’d be:

&aString

It’s the value of aString that I want, so missing value doesn’t help.


(Nigel Garvey) #2

Hi Phil. Do you mean this?

set {successful, aString} to aWorkspace's getFileSystemInfoForPath:"/" isRemovable:(missing value) isWritable:(missing value) isUnmountable:(missing value) |description|:(missing value) |type|:(reference)

(Phil Stokes) #3

Ah, so that’s how you deal with pointers. Cool!!

Thanks, Nigel. :smiley:


(Nigel Garvey) #4

It’s only usable in ASObjC with methods which return a result anyway, such as the boolean returned here by getFileSystemInfoForPath:…. In such cases, where any ‘pointer’ parameters are set to (reference), you get back a list containing the method result followed by an ASObjC value for each (reference) set. So if all five pointer parameters here are set to (missing value), the result’s just a boolean. If all five are set to (reference), the result’s a list containing the boolean and five other values.