Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does text in echo / dump / write / check steps require quotes? #242

Closed
kensoh opened this issue Jul 16, 2018 · 9 comments
Closed

Why does text in echo / dump / write / check steps require quotes? #242

kensoh opened this issue Jul 16, 2018 · 9 comments
Labels

Comments

@kensoh
Copy link
Member

kensoh commented Jul 16, 2018

This issue adds on to #241 where `variable` can be used instead of '+variable+' to denote variables where text is expected.

@kensoh kensoh added the query label Jul 16, 2018
@kensoh
Copy link
Member Author

kensoh commented Jul 16, 2018

The various TagUI steps by default expect context to be text instead of variables, to let scripts be more human-language-like. However, for some steps (echo, dump, write, check), the context by default is variable. This is because these steps are normally used for dealing with variables.

To make the default context text would mean additional effort when writing scripts using these steps. But to make default context variable, would mean these steps behave differently from most other TagUI steps. To review whether it makes sense to adjust the default context of these steps to be like the other TagUI steps, and whether it can be done with backward compatibility.

current way

echo 'Name of user: ' name
dump results to result.txt
write output to out.txt

for evaluation

echo Name of user: `name`
dump `results` to result.txt
write `output` to out.txt

@kensoh
Copy link
Member Author

kensoh commented Jul 18, 2018

thoughts after reviewing

For dump and write steps, it is easier to simply provide variable name instead of having to put ``.

For echo step, there isn't a way to implement this without breaking backward compatibility. Because something simple like echo name cannot be automatically parsed to determine if it is referring to a variable or a text and then handle it accordingly.

In theory can try and catch for error, but complication comes in when trying to echo text and repository / datatable. The new complexity will affect reliability in exchange for a more streamline syntax when scripting. Decision made for now is to drop this move that will break backward compatibility.

@kensoh kensoh closed this as completed Jul 18, 2018
@Hassan-Ali123
Copy link

Hey @kensoh! Nice to see you! I downloaded the latest version of TagUI (6.0.0). But when I print a text using a variable using the latest syntax it's giving me error.
EchoError. Please guide where am I doing mistake!

@Hassan-Ali123
Copy link

The latest syntax I am using is: echo message-to-print variable-name. This is the generic syntax I am using

@Hassan-Ali123
Copy link

On variable-name I am using backtick opertors to enclose it like variable-name

@kensoh
Copy link
Member Author

kensoh commented May 4, 2020

Hi @Hassan-Ali123 yes what you write is correct. Can you share what is the minimum simple script you have that can replicate the problem? Make sure that you are running TagUI v6. If you type tagui without any parameters it should show version as v6. In case somehow the old version is running.

For example, below sample script

a = '2'
echo 1 `a` 3

Will give the following run output on my v6

1 2 3

@Hassan-Ali123
Copy link

Hassan-Ali123 commented May 8, 2020 via email

@kensoh
Copy link
Member Author

kensoh commented May 21, 2020

For echo step, message no need quotes in v6 and variables need backticks in v6 -

See more info - https://github.com/kelaberetiv/TagUI#echo-dump-write-steps

@Hassan-Ali123
Copy link

Hassan-Ali123 commented May 21, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants