Shell - objective-c NSString

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Shell - objective-c NSString

Mark Wieder via use-livecode
Compile the following objective-c code as argv_nsstring-1

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        NSString *arg1 = [NSString stringWithUTF8String:argv[1]];
        NSString *arg2 = [NSString stringWithUTF8String:argv[2]];
        NSString *arg3 = [NSString stringWithUTF8String:argv[3]];
        NSLog(@"\nArgument 1: %@\n", arg1);
        NSLog(@"\nArgument 2: %@\n", arg2);
        NSLog(@"\nArgument 3: %@\n", arg3);
    }
   
    return 0;
}


Enter the following code in a button;

on mouseUp
   set the defaultFolder to "~/Desktop"
   put "ONE TWO THREE" into tFILE
   put shell( "./argv_nsstring-1" && tFILE) into pData
   put pData into fld id <YOURFIELD>
   beep 2
end mouseUp

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...