• WCC for WINServer

    From Robert Wolfe@21:2/136 to All on Fri Jan 11 21:40:10 2019
    Not that there are that many WINServer nodes here, just thought I would share
    a small WCC module I wrote in answer to another WINServer sysop's question in replacing an occurance of a character in a given string:

    //
    // Will search for a spaces in a string and replace it with %20
    // Coded by Robert Wolfe <robert.wolfe@winserver.org>
    //

    #include "util.wch"
    #include "cmdline.wch"

    if (GetNode() = 0) then
    LoginSystem()
    end if

    dim string1 as string = "Mr. John Doe, Sr."

    function string2(string1 as string) as string
    dim char as string = ""
    dim index as integer = 0
    dim temp as string = ""
    for index = 1 to len(string1)
    char = mid(string1, index, 1)
    if char = " " then char = "%20"
    temp = temp + char
    next index
    string2 = temp
    end function

    print "string1 = "; string1
    print "string2 = " ; string2(string1)

    ... Platinum Xpress & Wildcat!..... Nice!!!!
    --- Platinum Xpress/Win/WINServer v3.0pr5
    * Origin: fsxNet: Omicron Theta * Southaven, MS * winserver.org (21:2/136)