Mailtraq - the Complete Email Server
   

Enstar for Mailtraq email server sales & support
Making world-class Internet technology affordable  

Search for:

Advanced search

For()

Iterates through each item in a list, reassigning a given variable to the current item on each iteration. For() is a looping function similar to While() and Repeat(), where the content expression is evaluated each cycle.

result := For( list , varname , content )

list
A comma separated list of items
varname
The name of the variable into which the current list item will be placed during each cycle
content
The expression to be evaluated during each loop cycle
result
A concatenation of the evaluations through every cycle

Concatenates the numeric position of the letter "b" in each of the items within "my_list" to a variable named "test"

my_list := "boat,abacus,rebound";
test := For(my_list, "item",
  Pos("b", item)
);
MessageDlg(test)

Writes a list of names and fully qualified mailbox addresses in the console, one per line, to a file named \database\users.txt

Define("Name", GetSystemVar("/mailslots/" ++ box ++ "/Description"));
a := CreateFile("users.txt");
For(GetMailboxes(), "box",
  If(GetMailboxProp(box, "Type") = "mailbox",
    Write(a, "\q" ++ Name() ++ "\q <" ++ box ++ "@" ++ LOCALHOST ++ ">")
  )
);
CloseFile(a)
Mailtraq Highlights...
 SMTP Server     Mailtraq SMTP email server video IMAP Server     Mailtraq IMAP email Server video
 POP3 Server     Mailtraq POP3 email server video Proxy Server     Mailtraq proxy email server video
 Webmail Server     Mailtraq webmail email server video Mailing-list Server     Mailing list email server video
 Groupware Services     Mailtraq groupware email services video Spam and Virus control     Spam and virus control email server video

 

   Copyright © 2003 - 2011 Enstar Ltd, Enstar LLC & Fastraq Ltd. All rights reserved. Privacy policy.
   Mailtraq® is a registered trademark of Fastraq Limited.