How do I output name and value of a variable? [closed] - vbscript

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 8 years ago.
Improve this question
I am new to VB Script and have a question, how do I assign a Name to the Variables I have input so that they display on the screen?
For example, Once I have input a name I would like the final information box to show the Name value as:
Name: <entered value>
I understand how to assign the 'entered value' but not the 'Name' itself..?
name=inputbox("What is your name?", "Personal Details")
address=inputbox("Please enter your Full Address inc. Post Code", "Address")
tele=inputbox("Please enter your telephone number", "Telephone Number")
msgbox name &vbLf&vbLf& address &vbLf&vbLf& tele, 1, "New Customer Details"

The question isn't very clear so it's quite possible I've misunderstood, but if you just want to know how to add in a static string to your output, then you just add it as "Name: " &.
So combined with your code it would be something like:
msgbox "Name: " &name &vbLf&vbLf& address &vbLf&vbLf& tele, 1, "New Customer Details"

Related

Golang: GetRawData() of ginCtx gets empty value "len:0, cap:512" [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 8 days ago.
Improve this question
I'm trying to get the body of the request but the method for get it of gin Context does not brings anything.
my endpoint: foo.com/root?q=123
in the controller
bodyInBytes:=ctx.GetRawData()
body is equal to "" len:0, cap:512
get the body of request
my endpoint was: foo.com/root/?country=123
in the controller :
bodyInBytes:=ctx.GetRawData()// body = "" len:0, cap:512
but
country := ctx.Param("country")//country = 123
solution:
change the slash at the end of the endpoint
my endpoint now is: foo.com/root?country=123. (Note I removed the slash )
in the controller :
bodyInBytes:=ctx.GetRawData()// body = "{"test":"Test",} " len:64, cap:512
and
country := ctx.Param("country")//country = 123
by some reason gin don't bring the body when the url has a slash at the end of de endpoint "/"

Why it is showing `missing ',' before newline in composite literal` [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 3 years ago.
Improve this question
Why my vscode is showing this error
missing ',' before newline in composite literal
My code:
if title == "" && desc != "" {
msgs = database.UpdateNotification(&Notify, map[string]interface{}{
"Description": changedDesc,
}); msgs != nil {
log.Info("error while deleting notification")
}```
So you want to able to change the variable names dynamically?
There isnt any way of doing this. I suggest if you really need somthing like that you would use a Map.
Data map[String]String
Im not exactly sure what you need this for, or if this helps.

Is my syntax correct? [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 8 years ago.
Improve this question
Could someone tell me if they see any syntax erros, I do not know lua and I am trying to make a small edit to an addon I use. If my syntax is incorrect could you please show me how to correct it and if it is correct could you please confirm that it is correct.
if(name) then
if(name == "SomebodiesName") then
name = name .. " (Udders! someone pop a gbank =)";
end
end
Error I recieve when trying to run the addon with this code added to it:
Message: REDACTED.lua:411: attempt to call field 'GT' (a nil value)
Count: 1
Stack: REDACTED.lua:411: in function <REDACTED.lua:410>
Locals: self = BuffCheck_MinimapButton {
0 = <userdata>
}
(*temporary) = nil
(*temporary) = "attempt to call field 'GT' (a nil value)"
The syntax of the code snippet you've shown looks okay, according to CodingGround, which is an excellent site to visit (a) if you need to check something quickly but you don't have a particular development environment just lying around.
name = "x";
if(name) then
if(name == "x") then
name = name .. " (Udders! someone pop a gbank =)";
end
end;
print(name);
That outputs:
x (Udders! someone pop a gbank =)
(whatever that means).
Given that the error seems to be about calling a field 'GT' which is set to nil and nowhere in your code snippet, I would suggest the problem lies elsewhere.
(a) My other favorites are SQLFiddle and JSFiddle.

How do I convert ~24000 product titles into URL keys? [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 8 years ago.
Improve this question
I have an array with ~24000 products. The hash will be saved as a CSV and uploaded to a Shopify shop using the products import method.
When I manually create a single product, the product url key/handle is automatically generated based on the product title. When using the products import method (CSV), I'll have to specify it myself.
How do I convert the titles into product url keys?
Example:
title_1 = "AH Verse frietaardappelen"
url_key_1 = "ah-verse-frietaardappelen"
title_2 = "Lay's Sensations red sweet paprika"
url_key_2 = "lay-s-sensations-red-sweet-paprika"
I'm currently using:
<title>.downcase.gsub(' ','-').gsub("'", '-')
but this doesn't remove %, $, &, / etc. from the title. I want to make sure the url key/product handle is as clean as possible.
There must be a better way to do this, what could I try next?
There's a (private) to_handle method in Shopify's Liquid gem:
def to_handle(str)
result = str.dup
result.downcase!
result.delete!("'\"()[]")
result.gsub!(/\W+/, '-')
result.gsub!(/-+\z/, '') if result[-1] == '-'
result.gsub!(/\A-+/, '') if result[0] == '-'
result
end
Example:
to_handle("AH Verse frietaardappelen")
#=> "ah-verse-frietaardappelen"
to_handle("Lay's Sensations red sweet paprika")
#=> "lays-sensations-red-sweet-paprika"
Have a look at the gem String Urlize, it may help you write a script to do this.
I would suggest you to use Rails ActiveSupport::Inflector#parameterize solution - http://apidock.com/rails/ActiveSupport/Inflector/parameterize
It handles a lot of edge cases and should work well for you.
The best thing is to use parameterize method:
title_1 = "AH Verse $frietaardappelen".parameterize
Output: "ah-verse-frietaardappelen"
title_2 = "Lay's Sensations red %sweet paprika".parameterize
output: "lay-s-sensations-red-sweet-paprika"

Change format of json output [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 9 years ago.
Improve this question
The following method gives me:
ICD1 = []
def parse_kapitel(node)
ICD1 << {von: node.css('~ von_icd_code')[0]['V'],
bis: node.css('~ bis_icd_code')[0]['V'],
bezeichnung: node.css('~ bezeichnung')[0]['V']}
end
File.write('Icd1.json', ICD1)
an output that looks something like this:
[{:von=>"A00", :bis=>"B99", :bezeichnung=>"Bestim.....
But I would like an output that looks like this:
[{"von":"A00", "bis":"B99", "bezeichnung":"Bestim.....
How can I achieve this in an easy ruby way?
Do as below using Generating JSON :
require 'json'
[{ :von=>"A00", :bis=>"B99", :bezeichnung=>"Bestim" }].map(&:to_json)
# => ["{\"von\":\"A00\",\"bis\":\"B99\",\"bezeichnung\":\"Bestim\"}"]

Resources