PDA

View Full Version : <name> expected near `return'


ryanc
11-08-2007, 01:52 AM
Good Day

I am having a problem in compiling my Update Scripts with True Update 3.0. Upon verifying (check syntax) the on finish script for a screen in the updater I get the following error message: Line=x <name> expected near `return' this is line x

Screen.return(SR_SUCCESS);

Now I haven't made any changes to this script, I've simply just done a syntax check. If I load and complile a backup of this exact project I don't have any problems. But of course If I do attempt to make any changes to this script I get the error again.

Thanks for your time.

Adam
11-09-2007, 10:21 AM
Not sure exactly what the issue is but the syntax for that action should be:


Screen.Return(SR_SUCCESS);


Adam Kapilik

ryanc
11-22-2007, 01:40 AM
When I change the r to R as soon as the cursor moves away it reverts to lowercase "r". I thought that perhaps I couldn't write to the file, but I do have write access. Any other ideas?

I solved my problem by manually editing the .tu2 file, replacing "Screen.return" with "Screen.Return". But given that the editor reverts the case the script editor may be at fault.

Is it not possible that return being a reserved word, is being misidentified in the case of Screen.return by the syntax checker?

Adam
11-22-2007, 09:47 AM
I have run some tests here on my XP-SP2 machine and cannot replicate this issue. I am able to type in Screen.Return and it honors the capital R.

Adam Kapilik

ryanc
12-03-2007, 01:30 AM
The problem isn't with new additions, it is when editing an already existing script. The project I am using I have been using since I first implemented TU (about a year ago now).

In terms of replication it's really easy, I create a new project. Go the HTTP Download Screens On Finish Event and there it is "Screen.return"
---------------------------------------------

To Test What I did was open the project in Notepad++ to check all the caps of Screen.Return, which was all 100%. And at each stage of the editing the file I reloaded the file to check that it had remained in the correct case. So far so good.

However when getting to the script editor, the script editor had already changed Return to return. The file on the HD was still correct.
At this point I had not saved the file to the HD. I then try to a compile and I get the error, I imagine its using the in memory version of my script which has been modified by the syntax editor.

So I am still having this problem, needless to say it is Extremely annoying.
I have double checked the write permissions to the file the only "odd" thing about my setup is that I do all my Dev on a Subst Drive, which I imagine plenty other people do.

Can I submit my project to the support department to be checked out? Any
other suggestions?

My Setup:
OS Name Microsoft Windows XP Professional
Version 5.1.2600 Service Pack 2 Build 2600
OS Manufacturer Microsoft Corporation
System Manufacturer INTEL_
System Model D865GLC_
System Type X86-based PC
Processor x86 Family 15 Model 3 Stepping 4 GenuineIntel ~3192 Mhz
Processor x86 Family 15 Model 3 Stepping 4 GenuineIntel ~3192 Mhz
BIOS Version/Date Intel Corp. BF86510A.86A.0063.P18.0406220349, 2004/06/22
SMBIOS Version 2.3
Windows Directory C:\WINDOWS
System Directory C:\WINDOWS\system32
Boot Device \Device\HarddiskVolume1
Locale South Africa
Hardware Abstraction Layer Version = "5.1.2600.2180 (xpsp_sp2_rtm.040803-2158)"
Time Zone South Africa Standard Time
Total Physical Memory 1,024.00 MB
Available Physical Memory 327.79 MB
Total Virtual Memory 2.00 GB
Available Virtual Memory 1.96 GB
Page File Space 1.63 GB
Page File C:\pagefile.sys

True Update:
Version 2.0.6.0

Mark
12-04-2007, 03:17 PM
Hi Raync,

In your first post you said that you were using TrueUpdate 3.0 but given your last post I assume that you are using TrueUpdate 2.0 is this correct?

Now as far as the code is concerned you mean the code on the "On Finish" event of the "Download File (HTTP)" screen? The code is the following correct?


if(screen_globals.DownloadResult == 0) then
-- Return SR_SUCCESS so the calling script knows that
-- the file was downloaded successfully
Screen.Return(SR_SUCCESS);
else


What happens if you type Screen.Return(SR_SUCCESS); on the main screen? Does the capital R revert there as well? What if you copy and past Screen.Return(SR_SUCCESS); does that work?

Have you tried saving your project file using another name? Or to another drive?

ryanc
12-06-2007, 06:40 AM
Correct I am using True Update 2.0 my mistake.

I will try your suggestions

[edit]
As for saving to another file name, experience has taught me that for each change save to a new file name. So for each change I make to my True Update project I save to a new filename.

[edit 2]
Yes the screen in question is the download http screen.

The code editor isn't reverting Screen.Return (in the main screen). It still honors it in the main screen editor (Client/Server Scripts)

[edit 3]
As I load the screen for editing "Download File (HTTP) -> On Finish editor display it already as Screen.return and typing it (Screen.Return) in the editor reverts it to Screen.return

So there we have it

Mark
12-06-2007, 10:31 AM
Hi ryanc,

Please try to answer these questions as best you can:

1) When you say revert, do you mean that the character changes after you type it? Are you trying the full action each time?

2) Did you try pasting:

Screen.Return(SR_SUCCESS);

What happened when you did?

3) What happens when you try typing Screen.Return(SR_SUCCESS); on another event of the "Download File (HTTP)" screen? Does it work properly there?

4) What about on a different screen? Have you tried that does it work properly there?

5) What happens if you add another "Download File (HTTP)" screen, and then type Screen.Return(SR_SUCCESS);?

6) Have you tried uninstalling the software and reinstalling it? This is a very strange error that has never been reported to us, and cannot be replicated by any of our testers.

7) Do you have any screen capture software? Would it be possible for you to create a video of the revert happening so that we can see exactly what is happening?

ryanc
12-07-2007, 02:53 AM
I have recorded my testings in a flash video.

It makes it pretty clear as to what my problem is.

Mark
12-07-2007, 08:41 AM
Hi ryanc,

Thanks for the video, it really cleared things up for us on this end. What gave it away was the fact that "Return" was being coloured blue, meaning that it was being parsed as a keyword.

This is actually an editor setting, right-click on the script and select "Editor Settings". Then on the Language tab of the Editor Settings dialog you should see a checkbox that is checked near the bottom labeled "Fixup text case when typing language keywords." uncheck that checkbox and everything should work properly again.

ryanc
12-08-2007, 04:55 AM
Just tested it with the changed setting and it no longer occurs. But will I not be loosing some functionality with this setting changed?

Mark
12-10-2007, 07:45 AM
Hi ryanc,

You may be losing some functionality with that setting turned off. However it is turned off by default and it obviously is incompatible with the screen.Return() action since return is a keyword.

ryanc
12-10-2007, 08:17 AM
Is this not possibly a bug then? I haven't noticed anything different as yet, but then I haven't had to do any major work in the project of recent

Mark
12-10-2007, 12:29 PM
Hi ryanc,

No this is not a bug, everything is working properly.

The "Fixup text case when typing language keywords." checkbox does exactly what it says that it does. It ensures that the case of any keyword that it encounters is correct.

So with that option enabled, if "Return" is encountered the editor will notice that it is a keyword with the incorrect case an adjust it to be: "return". This is the correct functionality.

However this is incompatible with the Screen.Return() action since the action's name contains a keyword.

ryanc
12-11-2007, 01:45 AM
It's a feature that causes problems as it doesn't respect the Internal TU functions, if I understand you correctly?
Perhaps some sort of visual warning about enabling this option, if it renders TU unable to compile your in screen scripts?