Results 1 to 7 of 7

Thread: Time Functons

  1. #1
    Join Date
    Aug 2007
    Posts
    75
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Time Functons

    Hey guys,

    I want to use TheTime in my script. I can do this no probs, but how would i go about creating a string to compare it to? Has it got be const?I'd really like to be able to randomise the created string (so it doesn't have to stop at a set time)

    ie:
    Code:
    If (TheTime <= Created string) then
    
    Do stuff
    Regards

    Dude

  2. #2
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    You can't use a string when you are using math operators (<, >, =, <=, etc). Only integers. Unless you wanted to convert an string to a integer using the StrToInt function:

    SCAR Code:
    if (TheTime <= StrToInt(SomeString)) then
    begin
      blablabla...;
    end;

    But from what you are telling me about I think you want an integer instead of a string.

  3. #3
    Join Date
    Aug 2007
    Posts
    75
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Zeph thanks for the reply but that wouldnt work, TheTime Returns a string so you'd have to compare it with a string, you cant change TheTime to a Int because its got am/pm in the string.... so it has to be compared with a string.

    And you CAN use maths functions with strings...

    Code:
    if (TheTime >='1:55:00 PM')then
    
    writeln('Test Output '+TheTime);
    works fine..string>=string ...do suff works fine for me... But now i need to find out how to create a string during the scipt

    Thanks for the input though.

  4. #4
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    like he said convert to a string after converting to an integer and use timerunning it gets how long the script has been running.

  5. #5
    Join Date
    Aug 2007
    Posts
    75
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Jhildy: I'm using TheTime for a reason, i want my script to react in a set time period eg between 3pm and 5pm. I'm not too sure what you mean by
    like he said convert to a string after converting to an integer
    as i've said TheTime returns a string with letters in it so that cant be converted to an integer. So what are you suggesting i convert to a string after converting into an integer?

  6. #6
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    well first of all i see no TheTime function in divi3.11 i see a getsystemtime function though.

  7. #7
    Join Date
    Aug 2007
    Posts
    75
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thetime is a srl function (pre 4.0)...im not bothering with 4.0 till its fully out. will look into the scar function, returns time as ms int...looks promising hope its 24h!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 67
    Last Post: 03-25-2009, 10:32 AM
  2. This time... a different run time error...
    By uber jesus in forum OSR Help
    Replies: 4
    Last Post: 02-09-2007, 01:01 AM
  3. Long time listener...first time caller
    By Ransom in forum Who Are You ? Who ? Who ?
    Replies: 0
    Last Post: 11-04-2006, 02:05 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
  •