[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Move command not moving in SQR



I have written a 'move' function in SQR that invokes the system move command
(Win2K) on a 'source' file(s) and 'target' directory.  This works when I run
it from a command line, however, when I run it from and SQR, it moves one
file in the directory, then errs out.  The return code that I'm getting is
"1" -- "incorrect function".

Here's a snippet of code:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    !* Check for Windows Version
    !*
    if rtrim($_kc_WinVer,' ') = ''
        do kc-GetWindowsVersion
    end-if

    !* Make sure the source directory ends with a slash...
    !*
    if substr($Source_Directory,length($Source_Directory),1) <> '\'
        let $kc_tmp_s = '\'
    else
        let $kc_tmp_s = ''
    end-if

    !* Load command line
    !*
    let $kc_src_dir = $Source_Directory || $kc_tmp_s

    !* Determine command line by Windows Version...
    !*
    Evaluate $_kc_WinVer
        when = 'WinXP'
        when = 'Win2K'
            let $kc_cmd = getenv('COMSPEC') ||' /c move /y ' || $kc_src_dir
|| $Files_To_Move || ' ' || $Target_Directory
            break
        when-other  !* NT or other...
            let $kc_cmd = getenv('COMSPEC') ||' /c move ' || $kc_src_dir ||
$Files_To_Move || ' ' || $Target_Directory
            break
    end-evaluate

    !* Make the system call to back up the files
    !*
    CALL SYSTEM USING $kc_cmd #ReturnValue WAIT

    !* On Windows systems, a non zero value indicates a failure.
    !*
    let $tmp_ReturnValue = '(' || ltrim(edit(#ReturnValue,'999'),' ') || ')'
    if #ReturnValue <> 0
        display '  Move: Failed' noline
        display $tmp_ReturnValue
    else
        display '  Move: Succeeded' noline
        display $tmp_ReturnValue
    end-if

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Okay, I know this is more than a snippet...

Any help would be greatly appreciated.

TIA,

Steven Ross
Applications Developer/Analyst
sross@kcm.org