SPONSORS:






User Tag List

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Jun 2002
    Location
    pune,maharashtra,india
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    processing of List of strings

    hi,
    i have created a main win application , and defined it in frame.inc file.
    the application is as follows:-
    ---------------------------------------------
    [-] window MainWin xyzApp
    [ ] tag "xyz"
    [-] STRING EnterTrade (list of string lsData)
    [ ] string sTemp
    [ ] string stringReturned
    [-] for each sTemp in lsData
    [ ] Verify ([boolean] StrPos ("=", sTemp), TRUE, "data element contains equal sign")
    [ ] Print(StrPos ("=", sTemp))
    [ ] string sField = GetField (sTemp, "=", 1)
    [-] if (xyzApp.IsDefined (sField))
    [ ] window wControl = xyzApp.@(sField)
    [-] else
    [ ] raise 1, "*** Error: {sField} not defined in xyzApp"
    [ ] string sData = GetField (sTemp, "=", 2)
    [ ] string sHowEnter = NULL
    [-] if ([boolean] StrPos ("[", sData))
    [ ] sHowEnter = Lower (GetField (sData, "]", 1))
    [ ] sHowEnter = Right (sHowEnter, Len (sHowEnter) - 1)
    [ ] sData = GetField (sData, "]", 2)
    [ ] dataclass dClass = ClassOf (wControl)
    [-] switch (dClass)
    [ ] case PopupList
    [-] if (IsNull (sHowEnter))
    [ ] wControl.Select (sData)
    [-] else
    [-] switch (sHowEnter)
    [-] case "integer"
    [ ] wControl.Select (Val (sData))
    [-] default
    [ ] raise 1, "*** Error: no case for {sHowEnter}"
    [-] case TextField
    [ ] wControl.SetText (sData)
    [ ] stringReturned = wControl.GetText()
    [-] default
    [ ] raise 1, "*** Error: no case for {dClass}"
    [ ] return stringReturned
    ---------------------------------------------
    end of frame .inc
    ---------------------------------------------

    in the script file i am calling this method .The method call is as follows:-
    ---------------------------------------------
    [-] string str = xyzApp.EnterTrade ({...})
    [ ] "Name=sams"
    [ ] "email=sams@company.com"
    [ ] "address=SMTP"
    [-] if( str=="sams@company.com")
    [ ] print (" success")
    [-] else
    [ ] print ("FAILED")
    ---------------------------------------------
    end of script.t
    ---------------------------------------------
    i am getting the following error for the last argument passed to that method.
    ---------------------------------------------
    [ ] *** Error: address not defined in xyzApp
    [ ] Occurred in xyzApp.EnterTrade at C:\Segue\Test\frame.inc(90)
    [ ] Called from script at script.t(252)
    ---------------------------------------------

    regards,
    Suvarna.



    ------------------

  2. #2
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: processing of List of strings

    The problem seems straight forward. The variable 'address' is not defined within your Silk code for the application. Run this test in debug mode and look for an 'address' variable in debugs' "view/local variables" or "view/global variables" dialogs.

    Putting a set of single quotes around the braces in {sfield} would clarify the error to show that '{sfield}' has a special meaning; that it is not just another word in the sentence.

    Also you could easily eliminate the parsing for the equal sign by passing a record instead.

    John


    ------------------

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:24 PM.

Copyright BetaSoft Inc.