KD_raj185 rpgle code in as400 try this please - rpgle

an assignment operator is expected with the eval operation
a semi colon is not specified at the end of a free format statement
the name or indicator is not defined
the compiler cannot determine how the program can end try this please
hope its clear for issue

#1 & 2 are pretty evident, the error tells the line number in the source with the problem, just fix it. #3 is pretty evident as well, the error will tell you the name of the variable that is not defined.
#4 is the only one that is a bit tricky if you haven't seen it before. The compiler did not find a return from the main procedure, and also no place that *INLR is set on. Either of those things will fix that one.
Odds are that you just included some typos in your code. Please don't paste the entire source and error listing, just read the errors, and go find someone in your company that can tell you where in the source listing to find the errors. Or if you are using RDi, you could just click on the error, and it will take you directly to the problem.

Related

Corverting to Integer in Power Automate

I was searching for solution one by another and still have some problems, i am open to change even a whole schema, but i have time till weekend. If you have new solution show me, if i did something wrong please tell me.
This is where it happens
Also earlier i had problem with just initializing variable and puting there value from excel, but now i guess i am on right way. Earlier program told me that i am setting string to my int variable.
Yep, so i did that but still i receive:
InvalidTemplate. Unable to process template language expressions in
action 'var_name' inputs at line '0' and column '0': 'The template
language function 'int' was invoked with a parameter that is not
valid. The value cannot be converted to the target type.'.
I don't know what it meens and what to do, what i know is that i can still see and show what i got from my excel, also in excel file every cell i get is set to be Integer.
Can someone help me? I can show You more if its necessary.
I changed type of cells to intiger in my excel, also i made this function, and still none. Help, i do not have time and i worked on it for too long.

Why doesn't my excel vba if/or statement work correctly?

I'm comparing values of numbers from 2 data sheets, and I've dropped the relevant data from both into their own arrays. I need to find matching values to run other steps of analysis.
For i = Lbound(Array1) to UBound(Array1)
For j = LBound(Array2) to UBound(Array2)
If (criteria for Array2) then
variable = 11111
Else
variable = 22222
End if
If variable = Array1(i,1) Or variable = Array1(i,2) or variable = Array1(i,3) then
more steps
Else
more steps
End if
next j
next i
The first if statement sets the variable correctly, but the variable doesn't match any of the criteria. It doesn't go to the else like it should. Now I only know this because I walked through the code step by step. If I just F5 and run the thing, "Excel is not responding". I don't know what the hang up it. All of my variables are declared and assigned a type, I'm not missing any closing statements. And I have no idea what I'm doing wrong.
What do I need to check for in my code?
EDIT
Sorry, but in this instance I'm not allowed to upload any code here. It's work related, NDA kind of stuff. Hence the pseudo code. What I need to show wouldn't be a big deal(at least I don't think it would), but I'm not risking it.
My apologies.
The solution, as it turns out, has to do with a poorly named array(not me) and a simple typo(definitely me). I'm certain that would have been an easy solve for the good citizens of Stack Overflow if I would have been allowed to post actual code.
For what's it worth, I think it's dumb that I couldn't in this case. Thanks #ScottCraner and #SuperSymmertry for trying to be helpful even without much to go on.
Super, I'm still curious about Val. If you've got a minute, I would appreciate more knowledge on that. Anything from an actual person is better than Microsoft documentation.

Excel-VBA: is there a VBA command that reads it's own line number

My Excel 2016 VBA code has rare occasions of fatal errors (e.g. loss of variable or reference values).
It sends mail/text then.
I'm looking for a way to state in which module and code line the problem occurred.
Is there a VBA command that can read the module name and the line number?
...without hard-coding the module and function/sub name.
You can use Erl as long as you have added line numbers to the code.
My idea of best case scenario for emailing fatal errors:
Save all the user's input in a class variable. In case of error, mail the information to yourself plus the type of the error.
This should be enough to replicate and fix.
Concerning a way to get the module name without hardcoding - there is no such way. But using a hardcoded variable for the name is not that difficult - http://www.cpearson.com/excel/InsertProcedureNames.aspx

Write text to file function python

so I would like to ask you for help.
I was scooping and sweeping the internet so long for that and I did not find how to do it. What I just produced is totally wrong and my professor did bad time with formulating the task. it is entry level task on university I have already finished the hardest ones, but this one I just dont get what he wants
Translation is made by me so it might be little bit off, but bear with me, please.
"Create file "linewriter.py". This file will have function writeTextToFile, that will accept one parameter and on end is also one parameter. Function will take the parameter on input and chain it with variable STATIC_TEXT (stated bellow). Queue of chaining will be as follows: 1st static text and then argument of function. This way chained input will write to file of any given name and a the name of this file will be returned as input parameter of function.
STATIC_TEXT: “This is my static text which must be added to file. It is very long text and I do not know what they want to do with this terrible text. ”
...
What? I really don't get what he want's from me. Can you help? Thank you all :)
STATICKY_TEXT = "This is my static text which must be added to file. It is very long text and I do not know what they want to do with this terrible text.\nNew Line! "
saveFile = open ("exampleFile.txt","w")
saveFile.write(STATICKY_TEXT)
saveFile.close()
solved it :) but I COULD not figure it out for days haha ... silly me

Executing functions stored in a string

Lets say that there is a function in my Delphi app:
MsgBox
and there is a string which has MsgBox in it.
I know what most of you are going to say is that its possible, but I think it is possible because I opened the compiled exe(compiled using delphi XE2) using a Resource Editor, and that resource editor was built for Delphi. In that, I could see most of the code I wrote, as I wrote it. So since the variables names, function names etc aren't changed during compile, there should a way to execute the functions from a string, but how? Any help will be appreciated.
EDIT:
What I want to do is to create a simple interpreter/scripting engine. And this is how its supposed to work:
There are two files, scr.txt and arg.txt
scr.txt contains:
msg_show
0
arg.txt contains:
"Message"
And now let me explain what that 0 is:
First, scr.txt's first line is function name
second line tells that at which line its arguments are in the arg.txt, i.e 0 tells that "Message" is the argument for msg_show.
I hope my question is now clear.
I want to make a simple scripting engine.
In order to execute arbitrary code stored as text, you need a compiler or an interpreter. Either you need to write one yourself, or embed one that already exists. Realistically, the latter option is your best option. There are a number available but in my view it's hard to look past dwscript.
I think I've already solved my problem! The answer is in this question's first answer.
EDIT:
But with that, as for a workaround of the problem mentioned in first comment, I have a very easy solution.
You don't need to pass all the arguments/parameters to it. Just take my example:
You have two files, as mentioned in the question. Now you need to execute the files. It is as simple as that:
read the first line of scr.txt
check if it's a function. If not, skip the line
If yes, read the next line which tells the index where it's arguments are in arg.txt
pass on the index(an integer) to the "Call" function.
Now to the function which has to be executed, it should know how many arguments it needs. i.e 2
Lets say that the function is "Sum(a,b : integer)".It needs 2 arguments
Now let the function read the two arguments from arg.txt.
And its done!
I hope it will help you all.
And I can get some rep :)

Resources