SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Mar 2002
    Location
    India
    Posts
    63
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to Pass Window objects thru Database?


    Hi! All

    *In short- can we convert String into Window
    just like String into Number

    Details-

    I have common user Registration form with 30 HTMLTextFileds,
    I have created following structure in DB
    1) Window Name
    2) DataType
    3) Maxlength

    Now I want to fetch these records thru Db_fetch in following variables

    Window Wname
    String Sdatatype
    Number Nmaxlength

    But while assigning silk is demanding string variable instead of Window
    and if i assign Wname as String I cannot treat Wname as Window

    I have chkmaxlength function which requires Argument -

    chkmaxlength(Window Wname, Number maxlength, String FieldData)

    now How to Proceed





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

  2. #2
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Pass Window objects thru Database?

    try this function:

    WINDOW StringToWindow(STRING sWindow)
    {
    WINDOW w;
    INTEGER i,iTotalPieces;
    iTotalPieces = 1;
    for (i=1;i<=Len(sWindow);i++)
    {
    if SubStr(sWindow,i,1) == "."
    iTotalPieces ++;
    }
    w = NULL;
    for (i=1;i<=iTotalPieces;i++)
    {
    if w != NULL
    w = w.@GetField(sWindow,".",i);
    else
    w = @GetField(sWindow,".",i);
    }
    return w;
    }


    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

  3. #3
    Senior Member
    Join Date
    Dec 2001
    Location
    San Jose, CA
    Posts
    102
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Pass Window objects thru Database?

    Can't you data cast?

    string sWindow = "MyWindowStringFromDB"
    window wWindow = [window]sWindow

    Michael

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

  4. #4
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Pass Window objects thru Database?

    Look up SilkTest help topic titled: "Reference operator":
    "The reference operator (@expression) lets you refer to functions and variables indirectly, by name."

    Using this, you can refer to any "window" object using a string or string variable:

    @("MyWindow").Close()

    or

    STRING WindowNameVar = "MyWindow"
    @(WindowNameVar).Close()
    ------------------
    Rob Kapteyn

    [This message has been edited by RobKapteyn (edited 06-11-2002).]
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  5. #5
    Member
    Join Date
    Mar 2002
    Location
    India
    Posts
    63
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Pass Window objects thru Database?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by RobKapteyn:
    Look up SilkTest help topic titled: "Reference operator":
    "The reference operator (@expression) lets you refer to functions and variables indirectly, by name."

    Using this, you can refer to any "window" object using a string or string variable:

    @("MyWindow").Close()

    or

    STRING WindowNameVar = "MyWindow"
    @(WindowNameVar).Close()
    <HR></BLOCKQUOTE>


    Hi! Rob
    I tried it but Silk gives error msg. Variable MyWindow not defined, I have included inc. file in script file.

    And also Typecasting is not allowed for Window- error-incompatible types

    Actually i want to Pass Textfield-

    Mywindow.Textfield

    and then I want to use

    Mywin.Textfield.SetText("") - thru function

    -amit




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


    [This message has been edited by amitathawale (edited 06-17-2002).]

  6. #6
    Senior Member
    Join Date
    Jul 2000
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Pass Window objects thru Database?

    Try this:


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


    [This message has been edited by Brent Rolland (edited 06-17-2002).]

  7. #7
    Member
    Join Date
    Mar 2002
    Location
    India
    Posts
    63
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Pass Window objects thru Database?

    Thanx Brent,
    It has worked

    -amit

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

 

 

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 02:04 AM.

Copyright BetaSoft Inc.