Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-29-2017, 03:38 AM
qwaskita qwaskita is offline
Registered User
 
Join Date: May 2006
Posts: 3
String in Double Quotes

Is it possible to put String in Double quotes
strDate = date '+%d-%m-20%y,%H:%M:%S'
crt.Screen.Send ""date" & strDate "& chr(13)

i have unique server that required it.
Reply With Quote
  #2  
Old 12-29-2017, 09:02 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
Hi qwaskita,

It sounds like you're trying to get your output formatted like:

Code:
  "date 12/27/2017"
If that is the case you should be able to use something like:
Code:
 strDate = date '+%d-%m-20%y,%H:%M:%S'
 crt.Dialog.MessageBox """date" & strDate & """" & chr(13)
Does this get you the formatting you're looking for?
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 01-04-2018, 01:38 AM
qwaskita qwaskita is offline
Registered User
 
Join Date: May 2006
Posts: 3
Hi Ekoranyi,


Thanks for your reply

Quote:
It sounds like you're trying to get your output formatted like:

Code:
  "date 12/27/2017"
Actually, when i execute using " " in securecrt, in machine will not show those double quote but if not then will be error

while using below code result is:

Code:
 strDate = date '+%d-%m-20%y,%H:%M:%S'
 crt.Dialog.MessageBox """date" & strDate & """" & chr(13)
Code:
root>"date-and-time 04/01/2018 15:18:56"
     ^^^
error number 103: CLI command is not found
Already try
Code:
 crt.Dialog.MessageBox ""date-and-time " & strDate & """ & chr(13)
not working either
Reply With Quote
  #4  
Old 01-04-2018, 08:30 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
Hi qwaskita,

I'm sorry that didn't get you the results you're looking for.

I'm not sure that I fully understand the exact format you need to generate. In your first post it just indicated Date but in the most recent you're using date-and-time. If you manually type in the needed command what exactly should it look like?
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 01-05-2018, 04:21 AM
qwaskita qwaskita is offline
Registered User
 
Join Date: May 2006
Posts: 3
Hi Eric,


Command is not the matter.

problem is quotation and string, is it possible since this server is required it and string inside.


Code:
strDate = date '+%d-%m-20%y,%H:%M:%S'
crt.Dialog.MessageBox ""date" & strDate" & chr(13)
regards
q--
Reply With Quote
  #6  
Old 01-05-2018, 09:29 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,937
Hi q,

Quote:
problem is quotation and string, is it possible since this server is required it and string inside.
I am not really sure what you mean by the latter part of the above sentence.

If you are trying to escape a quotation mark, you would need to enclose it in a set of quotation marks.

Please try stating the issue and/or your objective in another way so we might assist you.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #7  
Old 01-06-2018, 08:50 AM
doc11 doc11 is offline
Registered User
 
Join Date: Jan 2013
Posts: 1
No sweat that.

In python use:-

line = 'blah_blah_string_formatting'

crt.Screen.Send(line + '\r')

In vbs use:-

mydate = 'whichever_format_minus_quotations'

crt.Screen.Send "my date did not work on " & chr(34) & "mydate" & chr(34) & chr(13)

which is a string => my date did not work on "mydate"


Failing the above use the script record function and capture your command as you execute it. When you stop the recording, the saved vbs will contain the exact format your command was dispatched. I don't like this method though because a simple script then becomes quite ambiguous and annoying to read every few months.

Is why I prefer python, line is line as you see it.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 08:13 AM.