invalid command name in TCL [closed] - tcl

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
invalid command name "if{0}{"
Giving me an error, for that I have find how many cell in the file.
Where am I making a mistake?
Update::::::::::::::::::::::::::::::::::::::::::::::::::::::::
I am having an issue while sorting an array...
It says
enter image description here
Since the last element is integer, still it says "expected integer but got...
Where am i making mistake?

You must place a space between 'if' and the opening brace.
Basicly, the Tcl interpreter tokenizes commands by searching for whitespace, while at the same time substituting stuff inside []. So first, the regexpr is evaluated, yieling 0 and togehter with the remaining characters this yields the command name.

Related

Exception of 50000 characters at 'SpreadsheetApp.flush()' in Google Sheets? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
I'm trying to import a list from my Gmail into a spreadsheet.
It has worked flawlessly several times, but I decided to do some cosmetic changes and now I get a baffling error:
var l = artikelen.length; //l = 40 in this case
var importSh = SpreadsheetApp.getActive().getSheetByName("import");
var range = importSh.getRange(2,1,l,1);
range.setBackground("#ab6e6e");
SpreadsheetApp.flush(); //throws error 'Input exceeds the limit of 50000 characters in a cel'
What is that? I'm not trying to put anything in a cell?? I'm just ordering to pick a range and set a colour AFAIK. Which in fact is not executed either...
What am I overlooking here?
Any suggestion will be welcome.
The culprit may be elsewhere in your code. Chances are that there is an attempt to put more than 50,000 characters in some cell.
Spreadsheet writes are lazy, and the error may only get shown when the script terminates, or at flush(), as the case seems to be here. To debug, add a flush() after every Range.setValues() and Range.setValue() call. Use console.log() to find what the values you are writing look like.

How to set more than one potential arguments for Keyword Element Should Contain from SeleniumLibrary in Robot Framework [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Could anyone help me with the following situation:
I need to check the value of a status cell in a table on a web page that can potentially have one of several different values (strings), for example: imported, done, failed.
I am using the keyword Element Should Contain from the SeleniumLibrary and would like to validate as a positive result, if the value is either imported, or done.
So far I only know how to check only for one of those, for example for imported, by using as an argument for the expected result - imported, however I need that in both cases, either imported or done, to be considered as passed.
Thank you very much in advance!
Suppose you can use for your purpose something like the following:
*** Settings ***
Library SeleniumLibrary
Test Teardown Close Browser
*** Variables ***
${BROWSER} Chrome
${URL} https://stackoverflow.com/questions/64679739/how-to-set-more-than-one-potential-arguments-for-keyword-element-should-contain
${ELEMENT_LOCATOR} //*[contains(text(), 'Ask Question')]
${EXPECTED TEXT 1} Ask Question
${EXPECTED TEXT 2} Anything else
*** Test Cases ***
Test with two acceptable values
Open Browser url=${URL}
... browser=${BROWSER}
${element}= Get webElement locator=${ELEMENT_LOCATOR}
${bool_result}= Set variable if '${element.text}' == '${EXPECTED TEXT 1}' or '${element.text}' == '${EXPECTED TEXT 2}'
... ${True}
... ${False}
Should be true ${bool_result}
... msg=Expected that element with locator '${ELEMENT_LOCATOR}' contains text '${EXPECTED TEXT 1}' or '${EXPECTED TEXT 2}', but got '${element.text}'
Close Browser
Here I've just created the boolean variable with the result of the comparison of my element's text and the acceptable two values (${EXPECTED TEXT 1} and ${EXPECTED TEXT 2}).

run function in function [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I'm new to Octave and I've a script that work in matlab that have following structure :
function []=myFunctionName()
...
a='path';
b=2;
c=5
d='x';
[x,y]=lecFunc(a,b,c,d);
plot(x,y);
...
function [k,t]=lecFunc(pt, nF, nS, val)
....
fid=fopen(pt,'r');
k=fread(fid,[1,N],'real*4');fclose(fid);
t=linspace(tmin,tmax,nt);
etc ...
And I get the error :
error: 'lecFunc' undefined near line 141 column 10
I couldn't understand why... I try to seprate the functions with endfunction and also put the function lecFunc at the top, but it still not work...
Could someone help me to understand this difference between matlab and octave ?
Thanks a lot !
You use lecFunc in myFunctionName. Try to define lecFunc before defining myFunctionName

Erlang store file contents in a list [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
code
read_CNF_File(FileName)->
case file:read_file(FileName) of
{ok, Data} -> print(binary:split(Data, [<<"\n">>], [global]));
{error, Reason} -> Reason end.
print([]) -> ok;
print([L|List]) ->
L,
print(List).
[Pic Related] How do I store contents from a file into a list (ideally a list of every line), if I try to io:fwrite As in read_CNF_File it seems to store it the way I want, however once I try to call print with that it just passes As as an empty list, thanks.
It is your print function that does nothing.
If you pass it à non empty list, it removes the first element (A in your code), the statement A, does nothing, and then recursively call itself with the tail of the list, until it is empty a' finally returns OK.

How to write a function output into .txt file? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have to write a function that produces random(parameter) integers i have to write random output of this funtion into .txt file. Also i have to find max and min integers from this function (write them into .txt too)
I cant find any tutorial about this subject. Want to use "a+" as writer.
Firstly, please have a look online for tutorials on how to write to a file. There are loads of free resources online.
You have already done a lot of the work and only needed few more lines
import random
def createRandomNumberFile(min, max, count, outputFileName):
outputFile = open(outputFileName, 'a+')
for item in range(0, count):
randomNumber = random.randint(min,max)
outputFile.write(randomNumber)
outputFile.close
Explanation - As you have assigned the file using the 'a+' mode (appending mode) to a variable (outputFile) you can simply use this variable to write to the file and then later close file (closing the file isn't always necessary but is good practice).
Hope that helps