SPONSORS:






User Tag List

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Jan 2003
    Location
    Portland, ME USA
    Posts
    603
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Casting from a Window to a String????

    I know silk can cast from a string to a window? but i am trying to do the reverse, in a function as follows.
    =============================================
    // Get all my children...
    void PrintChildren (WINDOW wWinToEnum optional)
    {
    LIST of WINDOW lwChildren; // Holds a list of windows...
    WINDOW wTemp; // Temporary object for looping...
    LIST of STRING lsFile;
    STRING sFile = "C:\MY_Test.txt";

    // If the caller didn't specify where to start...
    if (wWinToEnum == null)
    {
    // Start with ourself...
    wWinToEnum = this;
    }
    // Get the list of children...
    lwChildren = WindowChildren (wWinToEnum);

    // For each child in our list...
    for each wTemp in lwChildren
    {
    ListAppend (lsFile, @wTemp);
    PrintChildren (wTemp);
    }
    ListWrite (lsFile,sFile);
    }
    =============================================
    I get the error when i try to do a ListAppend on lsFile from the wTemp which is a window. This is what segue suggested to do, but none the less it doesn't work, I keep getting a type missmatch Variable should be a string. Has anyone been able to cast a string from window...???


    ------------------
    N+ CNA

    [This message has been edited by RCyr (edited 03-11-2003).]

    [This message has been edited by RCyr (edited 03-11-2003).]
    N+ CNA

  2. #2
    Senior Member
    Join Date
    Aug 2001
    Location
    Manchester, NH
    Posts
    121
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Casting from a Window to a String????

    I think you just need to do an explicit conversion

    ListAppend (lsFile, [string]wTemp);

    ------------------
    Adam Kuczkowski
    akuczkowski@frametech.com

  3. #3
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Casting from a Window to a String????

    How about:
    ?
    But then your call to PrintChildren in the next line is unlikely to work. If I understand what you're trying to do (to list all the children of a window, including a recursive call on each child, in the end listing all children (and grandchildren etc.) to a file), then I would recommend coding it like this:
    ------------------

 

 

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 07:43 PM.

Copyright BetaSoft Inc.