Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3

Thread: Not a string?

  1. #1
    Join Date
    Mar 2005
    Posts
    9

    Not a string?

    Any chance of somebody telling me what I'm doing wrong here.

    Code:
    function SaveForm()
    	local iValidity
    	local tValidity
    	local sData
    	local sPath
    	
    	iValidity = 0;
    	tValidity = ListBox.GetSelected("lbxFormValidity");
    	for index, item in tValidity do
    		iValidity = iValidity + ListBox.GetItemData("lbxFormValidity", index);
    	end
    	sPath = Input.GetText("inFormPath");
    	sData = Crypto.Base64EncodeToString(sPath);
    	sSQl = "INSERT INTO forms VALUES(NULL, '"..Input.GetText("inFormVersion").."', '"..Input.GetText("inFormName").."', '"..iValidity.."', '"..Input.GetText("inFormFileName").."', '"..ComboBox.GetText("cbxFormType").."', '"..ComboBox.GetText("cbxFormFormat").."', '"..Input.GetText("inFormDescription").."' ,'"..sData.."')";
    	Paragraph.SetText("Paragraph1", sSQL);
    	SQLite.Query(db, sSQL);
    	Error_Check();
    end
    Brings up the message that the sSQL variable for the following commands is not a string.

    Code:
    	Paragraph.SetText("Paragraph1", sSQL);
    	SQLite.Query(db, sSQL);
    However if I switch the sSQL for those two lines with

    Code:
    "INSERT INTO forms VALUES(NULL, '"..Input.GetText("inFormVersion").."', '"..Input.GetText("inFormName").."', '"..iValidity.."', '"..Input.GetText("inFormFileName").."', '"..ComboBox.GetText("cbxFormType").."', '"..ComboBox.GetText("cbxFormFormat").."', '"..Input.GetText("inFormDescription").."' ,'"..sData.."')"
    it works fine.

    Obviously I can just create the sql statement in the sqlite command, but I don't see why it doesn't work the other way.

    Cheers

  2. #2
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    Doesn't you have a lower-case "L" in
    sSQl = "INSERT INTO forms VALUES(NULL, '"..

    Try upper-case "L" like sSQL = …..

  3. #3
    Join Date
    Mar 2005
    Posts
    9
    Oh dear, I think I've been staring at this too long. Oh for Option Explicit!

Similar Threads

  1. Function : Validate String (Great for passwords, etc.)
    By Corey in forum AutoPlay Media Studio 5.0 Examples
    Replies: 3
    Last Post: 04-28-2005, 02:42 AM
  2. attempt to index a string value
    By csd214 in forum AutoPlay Media Studio 5.0
    Replies: 8
    Last Post: 08-08-2004, 01:23 AM
  3. "Get Delimited String" -- Delimiter can be a string?
    By Bishal in forum Setup Factory 6.0
    Replies: 1
    Last Post: 10-16-2003, 10:40 AM
  4. replace a character in a string
    By boudie in forum Setup Factory 6.0
    Replies: 7
    Last Post: 06-10-2003, 08:48 AM
  5. While loop in a string
    By Option_Explicit in forum AutoPlay Media Studio 4.0
    Replies: 4
    Last Post: 03-04-2003, 07:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts