Donate Now Goal amount for this month: 100 USD, Received: 200 USD (200%)
Donate to support this site and ThinBASIC project development

Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: timer / doevents / inet problem

  1. #21
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    47
    Posts
    7,583
    Blog Entries
    2
    Rep Power
    10

    Re: timer / doevents / inet problem

    Marting,

    try the following, change from:
    [code=thinbasic] function = UTF8ToAnsi$(strdata)[/code]
    to
    [code=thinbasic] function = acode$(UTF8ToWideChar$(strdata))[/code]
    in function "download"

    Mainly you need to pass from UTF8 to Unicode to Ansi.

    I'm still studying how those conversions take place, to be honest I'm not an expert of this field.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  2. #22
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    47
    Posts
    7,583
    Blog Entries
    2
    Rep Power
    10

    Re: timer / doevents / inet problem

    Martin,

    I just saw your example. Why are you making that DO/LOOP like:
    [code=thinbasic]
    do
    hInternet = INET_Internet_Open("test", %INTERNET_OPEN_TYPE_DIRECT)
    IF hInternet <> %NULL THEN EXIT DO
    loop
    [/code]

    Problem is that if function fails and hInternet will be zero, ode will enter into an infinite loop.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  3. #23
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    42
    Posts
    241
    Rep Power
    30

    Re: timer / doevents / inet problem

    whoohoo that works perfect!

    I know that this loop can be endless. What my script does is testing a lot of internetpages and then it put the results in a listview. So this download-function is called from a timer routine. So the main script is still running and my thought was that the loop will end if the internet connection is restored. But I agree I must think about a better way.

  4. #24
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    47
    Posts
    7,583
    Blog Entries
    2
    Rep Power
    10

    Re: timer / doevents / inet problem

    Quote Originally Posted by martin
    whoohoo that works perfect!
    Seems a good start
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Page 3 of 3 FirstFirst 123

Similar Threads

  1. INET download issue
    By nrodes in forum thinBasic General
    Replies: 1
    Last Post: 03-06-2009, 22:17

Bookmarks

Posting Permissions

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