Re: [NTLK] NTK1.6.4 MacOS9.1 memory problems

From: Paul Guyot (pguyot_at_kallisys.net)
Date: Tue Sep 04 2001 - 01:15:24 EDT


>I think you don't need to press alt, on my Mac it works with ctrl-cmd-esc
>and sometimes kills the actually 'running' application.

Actually, I need command-alt-esc.

> > Ctrl-Alt-Power doesn't do anything here.
>That's reset :-)

You mean ctrl-command-power, right?

>I got one question regarding the IF THEN ELSE statement in NTK. I wanted to
>exclude some Tiles from beeing read in by NTK by means of an IF THEN within
>two nested FOR loops, but was not successful. NTK complains probably about
>a missing ';' or other special character, but I have no idea why. My NS book
>says IF THEN does not need a ';' but there are some from other commands. How
>can I put all these commands into one block w/o ';' ? It looks like this:
>
>FOR X=0 TO xmax DO
> FOR Y=0 TO ymax DO BEGIN
> Filname := HOME & "T_" & STR(X) & "_" & STR(Y) & ".BMP"
> // IF Filename <> HOME & "T_3_0.BMP" THEN // this does NOT work !!!
> TRY
> rf := Open...
> ONEXCEPTION ...
>END;

You need to indent this according to what you're doing.
Besides, don't hesitate to put plenty of begin end, it's easier to
read and it doesn't cost anything.
I think the semi-colon missing is just after .BMP.
Also, <> doesn't do what you want with strings. Use StrEqual instead.

for index_x := 0 to xmax do
begin
        for index_y := 0 to ymax do
        begin
                local theFilename := HOME & "T_"
                        & index_x & "_" & index_y & ".BMP";
                if not StrEqual( theFilename, "T_3_0.BMP") then
                begin
                        try
                                local theRefNum := Open( ...
                        onexception |ex| do ...
                end; // if not StrEqual( theFilename, "T_3_0.BMP") then
        end; // for index_y := 0 to ymax do
end; // for index_x := 0 to xmax do

Paul

-- 
Home page: http://www.kallisys.com/
Newton-powered WebServer: http://newt.dyndns.org:8080/

-- This is the Newtontalk mailinglist - http://www.newtontalk.net To unsubscribe or manage: visit the above link or mailto:newtontalk-request_at_newtontalk.net?Subject=unsubscribe



This archive was generated by hypermail 2.1.2 : Wed Oct 03 2001 - 12:01:07 EDT