Page 1 of 1 1
Topic Options
#198713 - 2010-05-25 09:15 PM Please point out mistakes with this script
morpheus_exegis Offline
Fresh Scripter

Registered: 2009-09-11
Posts: 9
Loc: Ontario, Canada
It works for the most part but in the section posted below i have achieved a complete FAIL situation. the string concat is not right. Please point it out as i am oblivious to it atm.

 Code:

Function Button_Click()

 If $Form.OpenFileDialog.ShowDialog() = $System.DialogResult.OK

  DIM $message, $file1, $file2
  $file1 = $Form.OpenFileDialog.Filename
  $file2 = SUBSTR($Form.OpenFileDialog.Filename,0,LEN($Form.OpenFileDialog.Filename) - 3)+".cmp"
  $message = "Please wait..."

  $Cmd = 'CMP.exe '     ; base command
  $Cmd = $Cmd + '"' + $file1 + '" '   ; add the source argument
  $Cmd = $Cmd + '"' + $file2 + '" '     ; add the dest argument
  $Cmd = $Cmd + '-FLAG1 flag2 flag3'       ; add switches/flags

  Shell $Cmd

  $Textbox.text=$Textbox.text+@CRLF+$message+@CRLF+@CRLF+$file1+@CRLF+@CRLF+$file2

 EndIf

EndFunction



Edited by morpheus_exegis (2010-05-25 09:28 PM)
_________________________
--------------------------------------------
Morpheus Exegis
SAND TEK

Top
#198716 - 2010-05-26 04:41 AM Re: Please point out mistakes with this script [Re: morpheus_exegis]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
Display $cmd to the screen so you can see what you've put together. Might it be that you don't have the path to the exe?
Top
#198720 - 2010-05-26 09:40 AM Re: Please point out mistakes with this script [Re: Allen]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
What is cmp.exe?

The SHELL and $Textbox.text lines are probably the wrong way round.

You say the catenation is wrong, what do you mean? What does the final $Cmd look like? The code itself looks sound to me.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 781 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.143 seconds in which 0.107 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org