3 Replies Latest reply: Apr 27, 2012 11:25 AM by TopSteve
TopSteve Level 1 (65 points)

First sorry for the spelling I am dislex....

 

I am just starting out from a background of BASIC and C and are finding some of (LOTS) of the Objective-C strange. 

One problem that might help me on my way would be if someone could tell me how to implement the pseudo program included below in Objective-C.

 

let min-index=0

let max-index=200

dim a$(max-index)

match$="FAUSE"

 

open data-file

index = min-index

repate

a$(index)=line-input from file

index = index + 1

until EOF

max-index = index

 

input b$

 

for index = min-index to max-index

if a$(index) = b$ then

     match$ = "Match found"

next index

 

print match$

 

 

I would like this so that there is a window with a text entry box (input a$)  and a text display box (print match$)

 

 

Can any one show me how to do this?

  • Keith Barkley Level 5 (6,040 points)

    rewrite this in C and you can use it directly in Objective-C, which is a C superset.

     

    However, some of the Cocoa Array classes can take out a lot of the grunt work.

  • etresoft Level 7 (27,828 points)

    A short program like that would probably just be written in C. Objective-C is for large programs that need many objects to interact in real-time, as the user triggers them or as the system changes.

  • TopSteve Level 1 (65 points)

    The program is just a start point for a much bigger program but it includes all of the types of things I want help with.

     

    As for writting it in C would that not mean that the input and output be to a terminal? (I want to use a GUI)

     

    The documenation douse not help in working out how to interface C to "Interface Builder" to make a GUI?

     

    Thank you