I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
Use BASICTYPE P
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
Thanks David, but quick question,
Instead of using
compileCmd = uopy.Command("BASIC "+dname+" "+fname, session=_session)
should I use?
compileCmd = uopy.Command("BASICTYPE P "+dname+" "+fname, session=_session)
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
BASICTYPE is a TCL command. This will set the Basic Compiler to PICK type. You should be able to set it in your login paragraph.
The other method is to add BASICTYPE P as the first line of code in your program.
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
It doesn't work.. here is my code:
setTypeCmd = uopy.Command("BASICTYPE P", session=_session)
compileCmd = uopy.Command("BASIC "+dname+" "+fname, session=_session)
Same output. I tried BASICTYPE and ECLTYPE, but the mode is still 'u'.
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
If you change your source code and put this line at the top, it will compile correctly everywhere:
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
Alejandro,
Have you tried compiling adding +PICK?
e.g. BASIC PFile PName +PICK where PFile is the Program File, and PName is the Program Name.
Or have you tried the keyword PICK.FORMAT?
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
For uopy, or any UniObjects client, you can set the BASIC type in the UOLOGIN subroutine.
i.e.
SUBROUTINE UOLOGIN(RTNVAL,APPNAME)
* Parameters
* RTNVAL - If RTNVAL is a nonzero value, the connection is allowed. If it is zero, the connection is disallowed and an error message is returned.
* APPNAME - The name of the client application trying to establish the connection.
EXECUTE 'BASICTYPE "P"'
RTNVAL = 1
RETURN
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
Hi Tyrel,
I think I don't know how to use the +PICK option. I went to TCL first and tried:
:BASIC BP TEST PICK
item id =TEST
Compiling Unibasic: ACCOUNTSHRPY.DBDEFN.SRCBPTEST in mode 'p'.
compilation finished
item id =PICK
errno=2: No such file or directory
The +PICK option is a UOPY option?
And for the PICK.FORMAT, no idea how to use or set that keyword.
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
Hi Mike, thanks for the suggestion,
This worked like a charm. Any idea where can I get more documentation about this? This is awesome.. thank you so much
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
Sorry, I had that wrong; I should have said +$PICK. It's basically using a compiler directive at the command line, so it's part of UniVerse BASIC command.
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
Oh ok.. I will give it a try just to see..
Thanks :)
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
Mike,
You Said
"For uopy, or any UniObjects client, you can set the BASIC type in the UOLOGIN subroutine."
how does machine determine if the connection is from UniObjects ?
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
@robert modrich
Robert,
When you connect to UD (or UV) using UniObjects your first connection request goes the unirpcd process and it checks the service name you are requesting to connect to.
So for UniObjects this would we udcs (for UniData) , uvcs for (UniVerse) or defcs (defcs is the default and will be set to UV or UD if only UV or UD are installed). Below are the example service names from the unirpcservices file.
udcs /disk1/ud82/bin/udapi_server * TCP/IP 0 3600
uvcs /disk1/uv1132/bin/uvapi_server * TCP/IP 0 3600
defcs /disk1/ud82/bin/uvapi_server * TCP/IP 0 3600
You will see that a UniObjects connection will run a udapi_server process (or uvapi_server process) and is the fact that it is running this process that allows UD or UV to determine if your running from a UniObjects connection.
Regards,
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
Jonathan
when executing a basic program in the login proc what command is used to determine if login came from uniobjects?
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
@robert modrich
There isn't a command you can execute to determine if the login came from UniObjects.
Environment variable @USER.TYPE
Returns the type of process currently running. UniBasic has four types of processes:
0 – Normal terminal processes.
1 – Background (phantom) processes.
2 – Redirected standard input.
3 – UniObjects, or any other client process.
The environment variable @U2PY
@U2PY
A string that returns the number of the Python level at which the current BASIC program is running. Without Python, @U2PY has the value of 0. With Python, @U2PY has the value of a positive integer (1, 2,3, ...).
The function SYSTEM(55)
Returns the number of the Python level at which the current BASIC program is running.
Returns 0 without Python.
Returns the value of a positive integer (1, 2, 3, ...) with Python.
Note: SYSTEM(55) has been implemented to return the same value as @U2PY.
Regards,
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
Alejandro,
It is mentioned in a few different documents.
For instance:
Rocket U2 Clients and APIs - Administrative Server Settings and Logging for U2 Clients
See "Chapter 6: U2 server security control subroutine and U2 environment settings"
I have a Python script that uploads a program and tries to compile it. But every time it compile my program errors because we use Pick.
Can we set up some options so the command executes using Pick flavor?
I already tried setting the TCLTYPE before running the command, but it doesn't work.
Connection established
done reading
file uploaded
Compiling Unibasic: TESTPROGRAM in mode 'u'.
main program: syntax error at or before
<line 2578> READSELECT NH ELSE HN.RECS = ""
-----------------------^
Expecting: =,:,+,-,*,/,[,<
Any suggestions?
Thanks in advance
@robert modrich
To pile on to Jonathan & Mike's great comments -
An example of using USERTYPE - a program that can run either in interactive mode or as a background process. This program has screen output and inputs in interactive mode and suppresses inputs and output if the USERTYPE = 1.
An example of where UOLOGIN is very useful - if you set up a service account dedicated to one specific uniobjects use, then you take action based specifically for that "user". For example, all calls to the backend from the web use a login of "redback" you can take action only for that service account (certain programs are run to initialize some common variables, etc.).
Another example is that you need to allow developers to login to the unidata shell and all other users are by default forced into the application (and not allowed shell access).