Asked — Edited

Exponential Notation E

I am saving a number in to a variable and when I retrieve the number from the variable it is in exponential notation. Is it possible to tell ARC NOT to do this? The number I am storing is the conversation ID to be sent to a chatbot.

RichardZ


ARC Pro

Upgrade to ARC Pro

ARC Pro is more than a tool; it's a creative playground for robot enthusiasts, where you can turn your wildest ideas into reality.

#9  

@ptp

Please forgive me as I'm not a programmer but the reason, as I see in the example above :

if ($str1=="12345 foo")

is not coming up with a "good" in the output is because a space is needed before foo

$str1=$str1 + " foo"

If you know this and I am not understanding what is going on, please forgive me?

PRO
USA
#10  

@HerrBall

you missed the step 1


$id="12345"

#1) assign id plus a space to str1
$str1=$id + " "

#2) append to str1 the word foo
$str1=$str1 + "foo"

#3) expected str1 content: id plus a space plus foo

#11  

I understand now says the grasshopper to the master ... lol. I do see the problem now, and glad you took the time to point it out to me.

#12  

Richard, I am familiar with Botlibre, I had replied to your old thread and tested your old code and got it work just fine and I built and tested chat bot in BotLibre. I did not like it myself as it did not fit my needs.

If you'd like to share your own specific code that you are specifically having an issue with getting to work with Botlibre I'd be happy to take a look. I don't seem to have special start conversation requirements with my Botlibre bot.

BTW, SELF as a scripting programming language is really obscure, while it's roots have been around 30 years and they say it inspired JavaScript.

If it were me I would be personally be temped to steer clear of SELF scripting if possible and stick to the AIML because that is XML and that's a lot easier to read and follow and find tutorials and videos online to learn about.

BUT if you do want to learn more about SELF BOTLibres own documents claim it uses JavaScript. So if you wanted to really learn more you could seek online learning resources on JavaScript because you should be able to find a TON and what you learn there should translate back to SELF.

PRO
USA
#14  

@Justin Thanks for the interest. I will post something when I get home this evening.

RichardZ

PRO
USA
#15  

@Justin Ok Justin you asked for it. This is the Get User Data Routine:


#This script gets user data from an excel spreadsheet.
#This Script assumes that $FullName equals the users
#full name, and variable $ColumnRequest equals the 
#column number for the chart below.
#The data from the request column is returned thru the 
#DataResults.txt file in variable $RequestedData
#Will add more columns as the needs arise.
#***********************************************************
# Column 1 = Full Name - Always look up using Users Full Name
# Column 2 = User Name - Name used when Talking to User
# Column 3 = User Number - At this time not used
# Column 4 = Conversation ID - Number generated by BotLibre when first talked to User
#            and then sent to BotLibre to keep track of conversations with user.
# Column 5 = Last Seen (Date Time)
# Column 6 = Last Talked (Date Time)
# Column 7 = 
#
#************************************************************
#Next 2 lines are for testing 
$FullName = "Richard Zimmerman" 
$ColumnRequest = 4

:GetUserData

$ReadFile = "c:\users\richard\unas\DataResults.txt"
$WriteFile = "c:\users\richard\unas\DataRequest.txt"
FileReadClose($ReadFile)
FileDelete($ReadFile)
FileDelete($WriteFile)
FileWriteLine($WriteFile, $FullName)
FileWriteLine($WriteFile, $ColumnRequest)
#FileReadClose($ReadFile)

Exec("C:\users\richard\unas\unas.bat") 

FileReadReset($ReadFile)
$RequestedData = FileReadLine($ReadFile) 

Return 

PRO
USA
#16  

The unas.bat file runs the following VBScript file.


Dim objExcel,objWorkbook,objSheet,RequestCell,MyData, cCount

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("c:\users\Richard\Unas\Unas.xlsx")
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)

Set objFSO = CreateObject("Scripting.FileSystemObject")

InFile = "c:\users\richard\unas\DataRequest.txt"
outFile = "c:\users\richard\unas\DataResults.txt"
Set objOutFile = objFSO.CreateTextFile(outFile, true)
'Set objOutFile = objFSO.OpenTextFile(outFile, 2, true, 0)
Set objInFile = objFSO.OpenTextFile(InFile)
strLine1 = objInFile.ReadLine
strLine2 = objInFile.ReadLine
cCount = 1
Do Until objSheet.Cells(cCount,1).Value = strLine1
cCount = cCount + 1
Loop

MyData = objSheet.Cells(cCount,clng(strLine2)).Value
'MsgBox MyData
objOutFile.Write MyData
objOutFile.Close
objExcel.ActiveWorkbook.Close
objExcel.Workbooks.Close
objExcel.Application.Quit

Set objExcel = Nothing
objInFile.Close