Pascal Hello World is not working - pascal

I am just trying to learn something new, so I am trying Pascal, but just simple hello world is not working with errors -
Novy1.pas(12,3) Fatal: Syntax error, ";" expected but "identifier WRITELN" found
Error: C:\FPC\3.0.2\bin\i386-win32\ppc386.exe returned an error exitcode
My code
program Hello;
begin
writeln('test');
readln();
end
Please help.

Related

Using Python shutil.copy to overwrite a file gives asyntax error

I am trying to overwrite one .png file with another using shutil.copy, but I keep getting a syntax error. The line in question is-
shutil.copy("/var/www/vk7krj/running/yoga.png", "/var/www/vk7krj/running/run4.png")
and the error is-
File "./latlong4.py", line 63
shutil.copy("/var/www/vk7krj/running/yoga.png","/var/www/vk7krj/running/run4.png")
SyntaxError: invalid syntax
with an up-arrow under the l in shutil
I have "import shutil" and also "from shutil import copyfile" in the head of the file.
Several hours of google searching has turned up nothing, so any assistance would be great.
Problem solved- turns out the error was incorrect indentation in an if-else earlier in the script- corrected that and the syntax error went away.

How can I handle the error in load_svmlight_file?

when I run this code in mac:
x_train, y_train = load_svmlight_file("mq2008.train")
I get this error in bash:
-bash: syntax error near unexpected token `('
and if I run it in shell, I face this error:
NameError: name 'load_svmlight_file' is not defined
How can I solve this problem?
Welcome to StackOverflow!
IMO, you have a Python code and trying to replicate its output. If so, you should first load all Python-related imports first. This is what it means to NameError here, Python interpreter is not able to understand what it is, because this function is not part of its existing definitions it has.
If I may suggest, please spend some time to get the hands-on-learning of Python.

What is the correct way to use a stack with a scanner block in Ragel?

I'm using Ragel 6.10 with Go. I'm sure it's likely an issue with my code but I'm getting some weird errors when I try to use a stack with a scanner block. I'm trying to setup bracket matching and my code looks roughly like this;
ObjectValues := |*
# other stuff
'}' => { fret; };
*|
main := ('{' #{fcall ObjectValues;})*;
Looking at page 46 in the guide it looks like this should be possible. When I run Ragel ragel -G2 -Z main.rl. I get the following error when I try to compile (it only happens for -G2 FSM generation);
graphql_collections.rl:47[/Users/nathanfisher/workspace/go/src/github.com/nfisher/gir/graphql_collections.go:325:2]: syntax error: unexpected goto at end of statement
graphql_collections.go:60[/Users/nathanfisher/workspace/go/src/github.com/nfisher/gir/graphql_collections.go:60:1]: label _again defined and not used
Commenting out the fret line removes the error and warns postpop and prepush are unreachable.
The full code is here;
https://github.com/nfisher/gir/blob/broken/graphql_collections.rl#L47
A working minimal test-case is here;
https://gist.github.com/nfisher/649ca816f82bb3ccd7164331ac2324ac
Error for test-case;
main.rl:13[/Users/nathanfisher/workspace/go/src/github.com/nfisher/gir/command/runner/main.go:119:2]: syntax error: unexpected goto at end of statement
main.go:59[/Users/nathanfisher/workspace/go/src/github.com/nfisher/gir/command/runner/main.go:59:1]: label _again defined and not used
It looks like this is an issue relating to Ragel's generated code in v 6.10. Using the HEAD of ragel-6 branch fixes the issue. Thanks to Adrian Thurston for being super responsive/helpful via Twitter. :)
Reformatting the code from this;
To this fixes the error;

How to correctly add resources in a rc file

I'm working on a project I did not start and I added
#define IDS_SELF_UPDATE_EXIT 266
and
IDS_CONFIRM_EXIT "Are you sure you want to quit?"
and I got the following error twice:
error RC2135: file not found
What am I doing wrong?
You seem to be trying to create a stringtable resource. The correct syntax is
STRINGTABLE
BEGIN
IDS_CONFIRM_EXIT "Are you sure you want to quit?"
END

VBScript Expected End 800A03F6

I am getting this error while trying to run a VBScript (note this is not in a web environment - just running a VBScript on Windows):
Line: [Last line]
Error: Expected 'End'
Code: 800A03F4
Source: Microsoft VBScript compilation error
I think it is an If statement that is not closed correctly with an "End If," but I've gone through every instance of "If" in the code and cannot find the error. Any tips or tools that could help me figure out where/why this error is occurring?
There was an "Else If" - there should be no space there: "Elseif"
http://www.w3schools.com/asp/asp_conditionals.asp
Hopefully this will help someone out in the future.
In VBScript If is not the only token that requires an End. Also look for Function's and Sub's without their appropriate end statements.

Resources