Jump to content

make shure the larges controle output [Solved]


 Share

Recommended Posts

Hi

Wasn't sure what to give tis tropic as title :blink: so it could describe my prob.

Long time ago Jchd help me correct a function that splited a string read from an input up into chops of 56 char, and that works like a charm (Thread) but but :nuke:

i have now been asked to add another input, and now i ran into a big prob.

The result of the chopping is added to a html file 56char pr line up to 4 lines (223char total(Y i know that 56x4 = 224 :)) but with the new input i have to set the output to the larges one, no prob there - how ever if one contains 200chars and the other only contains 6chars i don,t know how to handle that, and hopes that some of U can help on the right track.

a part of the code i current use is:

If $1_Customer1 <> "" Then
        Local $String = $1_OrdreNr1
    
        Local $len = StringLen($String)
        If $1_KoNr1 <> "" Then ; Some error check
            Local Const $limit = 56
            Local $nbStr = Floor(($len + $limit - 1) / $limit)
            Local $aStrings[$nbStr]
            For $i = 0 To $nbStr - 1
                $aStrings[$i] = StringLeft($String, $limit)
                $String = StringTrimLeft($String, $limit)
            Next
        EndIf


        If $len = "223" Then
            $y = $Total - 1
            $RCustomer[$y] = $1_Customer1
            $RCollieCount[$y] = $1_CollieCount1
            $RCollieType[$y] = $1_CollieType1
            $RWeight[$y] = $1_CollieWeight1
            ; Sets Ordre Numbers
            $ROrdre[$y] = $aStrings[0]
            $ROrdre[$y + 1] = $aStrings[1]
            $ROrdre[$y + 2] = $aStrings[2]
            $ROrdre[$y + 3] = $aStrings[3]
            $Total = $Total + 4
        ElseIf $len > "168" Then
            $y = $Total - 1
            $RCustomer[$y] = $1_Customer1
            $RCollieCount[$y] = $1_CollieCount1
            $RCollieType[$y] = $1_CollieType1
            $RWeight[$y] = $1_CollieWeight1
            ; Sets Ordre Numbers
            $ROrdre[$y] = $aStrings[0]
            $ROrdre[$y + 1] = $aStrings[1]
            $ROrdre[$y + 2] = $aStrings[2]
            $ROrdre[$y + 3] = $aStrings[3]
            $Total = $Total + 4
        ElseIf $len > "112" Then
            $y = $Total - 1
            $RCustomer[$y] = $1_Customer1
            $RCollieCount[$y] = $1_CollieCount1
            $RCollieType[$y] = $1_CollieType1
            $RWeight[$y] = $1_CollieWeight1
            ; Sets Ordre Numbers
            $ROrdre[$y] = $aStrings[0]
            $ROrdre[$y + 1] = $aStrings[1]
            $ROrdre[$y + 2] = $aStrings[2]
            $Total = $Total + 3
        ElseIf $len > "56" Then
            $y = $Total - 1
            $RCustomer[$y] = $1_Customer1
            $RCollieCount[$y] = $1_CollieCount1
            $RCollieType[$y] = $1_CollieType1
            $RWeight[$y] = $1_CollieWeight1
            ; Sets Ordre Numbers
            $ROrdre[$y] = $aStrings[0]
            $ROrdre[$y + 1] = $aStrings[1]
            $Total = $Total + 2
        Else
            $y = $Total - 1
            $RCustomer[$y] = $1_Customer1
            $RCollieCount[$y] = $1_CollieCount1
            $RCollieType[$y] = $1_CollieType1
            $RWeight[$y] = $1_CollieWeight1
            ; Sets Ordre Numbers
            $ROrdre[$y] = $aStrings[0]
            $Total = $Total + 1
        EndIf

this code checks the len of the input, and put the result in to 4,3,2 or 1 line in my html file (the html file is build in tables, where the Ordre table only can hold 56 chars, so if the len is over 56chars i have to move the content 1,2 or 3 lines down and then write 56 per line).

So i have to "fill" the lowest on with blanks or something to the text in the html stands correct.

I'm realy trying to make my self clear on what i need help to, but i have no idea how to translate it correct to English :P but i hope that i can give a hint ;)

Cheers

/Rex

:Edit Set titel to solved -> Se my last post :>)

Edited by Rex
Link to comment
Share on other sites

Not really sure how your code is laid out for both script and html -- but maybe this might help

#include <Array.au3>

Local $String = "5F48B75FC8A8435F0FEFFFF8B7DF486843DF0FEFFFF888435F0FEFFFFFF45FCEBB08D9DF0FEFFFF31FF89FA39550C76638B85ECFEFFFF4025FF0000008985ECFEFFFF89D80385ECFEFFFF0FB6000385E8FEFFFF25FF0000008985E8FEFFFF89DE03B5ECFEFFFF8A0689DF03BDE8FEFFFF860788060FB60E0FB60701C181E1FF0000008A840DF0FEFFFF8B750801D6300642EB985F5E5BC9C21000"

Local $ma = StringRegExp($String, '(.{1,56})', 3)
Local $ub = UBound($ma) - 1

For $i = 0 To $ub
    ; Do something here
    MsgBox(0, '', $ma[$i] & @CRLF & 'Length: ' & StringLen($ma[$i]))
Next
_ArrayDisplay($ma)

; possible code to work with

If $ub < 5 Then; Test count of cells in array

    For $i = 0 To $ub
        If StringLen($ma[$i]) = 56 Then
            ; Do something here
        Else
            ; Do something else here
        EndIf
    Next

Else
; Do something else here
EndIf

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

Not really sure how your code is laid out for both script and html -- but maybe this might help

#include <Array.au3>

Local $String = "5F48B75FC8A8435F0FEFFFF8B7DF486843DF0FEFFFF888435F0FEFFFFFF45FCEBB08D9DF0FEFFFF31FF89FA39550C76638B85ECFEFFFF4025FF0000008985ECFEFFFF89D80385ECFEFFFF0FB6000385E8FEFFFF25FF0000008985E8FEFFFF89DE03B5ECFEFFFF8A0689DF03BDE8FEFFFF860788060FB60E0FB60701C181E1FF0000008A840DF0FEFFFF8B750801D6300642EB985F5E5BC9C21000"

Local $ma = StringRegExp($String, '(.{1,56})', 3)
Local $ub = UBound($ma) - 1

For $i = 0 To $ub
    ; Do something here
    MsgBox(0, '', $ma[$i] & @CRLF & 'Length: ' & StringLen($ma[$i]))
Next
_ArrayDisplay($ma)

; possible code to work with

If $ub < 5 Then; Test count of cells in array

    For $i = 0 To $ub
        If StringLen($ma[$i]) = 56 Then
            ; Do something here
        Else
            ; Do something else here
        EndIf
    Next

Else
; Do something else here
EndIf

This is a part of my script containing the html part to (Yes i know totaly wrong and extreem bad coded, but i works ;))

_Tab_Info()
    _Tab_F1_C1()
;Goes all the way down to ->
    _Tab_F3_C5() ; <- This
    _Total()

    If $Html = 2 Then ; If we have more ordre numbers then there's room for on one page we use the html with room for the rest.
        FileCopy(@ScriptDir & "\Lib\String2.Html", $SaveIN & "\" & $Read_Company_Strip & "_" & $NowDate & $NowTime & ".html")

    Else
        FileCopy(@ScriptDir & "\Lib\String.Html", $SaveIN & "\" & $Read_Company_Strip & "_" & $NowDate & $NowTime & ".html")
        $Max = 35 ; If we can fit it all on one paper max is 35
    EndIf

    $Filename = $SaveIN & "\" & $Read_Company_Strip & "_" & $NowDate & $NowTime & ".html"
    $FreightSave = @ScriptDir & "\FragtBreve\" & @MDAY & "-" & @MON & "-" & StringTrimLeft(@YEAR, 2) & "\" & $Read_Company_Strip & "_" & $NowDate & $NowTime & ".pdf"
    _FileWriteMyLog($LogFile, "Fragtbrev: Oprettede " & $filename)

    ; Read Sender info from ini file.
    $Account = IniRead($Settings, "INFO", "ACCOUNT", "")
    $Set = IniReadSection($Settings, $Account)
    $Sender_Account = _HexToString($Account)
    $Sender_CompanyName = _HexToString($Set[1][1])
    $Sender_Address1 = _HexToString($Set[2][1])
    $Sender_Address2 = _HexToString($Set[3][1])
    $Sender_zip = _HexToString($Set[4][1])
    $Sender_City = _HexToString($Set[5][1])
    _FileWriteMyLog($LogFile, "Fragtbrev: Sendt pÃ¥ afsender Konto " & $Sender_Account & " (" & $Sender_CompanyName & ")")


    Local $String = $Read_Add_OrdreNr
    Local $len = StringLen($String)
    If $Read_Add_OrdreNr <> "" Then ; Some error check
        Local Const $limit = 56
        Local $nbStr = Floor(($len + $limit - 1) / $limit)
        Local $aStrings[$nbStr]
        For $i = 0 To $nbStr - 1
            $aStrings[$i] = StringLeft($String, $limit)
            $String = StringTrimLeft($String, $limit)
        Next
    Else
        $len = StringLen($Read_OrdreNr) ; If no add Ordre number has ben typed, we use the "master" ordre number
    EndIf

    Local $KString = $Read_Add_KoNr
    Local $Klen = StringLen($KString)
    If $Read_Add_KoNr <> "" Then ; Some error check
        Local Const $Klimit = 56
        Local $nbStr = Floor(($Klen + $Klimit - 1) / $Klimit)
        Local $aKStrings[$nbStr]
        For $i = 0 To $nbStr - 1
            $aKStrings[$i] = StringLeft($KString, $Klimit)
            $KString = StringTrimLeft($KString, $Klimit)
        Next
    Else
        $Klen = StringLen($Read_KoNr) ; If no add Ordre number has ben typed, we use the "master" ordre number
    EndIf

    ; Search and Replace part
    ; Company and Sender /-> Search // $Find[] -> is an array contaioning 15 items
    ; Reciver
    $F_Info[0] = "COMPANY_NAME"
    $F_Info[1] = "ADDRESS"
    $F_Info[2] = "ADDRESS2"
    $F_Info[3] = "ZIP"
    $F_Info[4] = "CITY"
    ; Sender
    $F_Info[5] = "SENDER_NAME"
    $F_Info[6] = "SENDER_ADDRESS1"
    $F_Info[7] = "SENDER_ADDRESS2"
    $F_Info[8] = "SZIP"
    $F_Info[9] = "SENDER_CITY"

    $F_Info[10] = "DATE"
    $F_Info[11] = "ORDRENR"
    $F_Info[12] = "KONUMBER"
    $F_Info[13] = "RECIVE_DATE"
    $F_Info[14] = "BEFORE_TIME"
    $F_Info[15] = "COMMENT"
    ; Company and sender /-> Replace // $Replace[] -> is an array contaning 15 items
    ; Reciver
    $R_Info[0] = $Read_Company
    $R_Info[1] = $Read_Address1
    $R_Info[2] = $Read_Address2
    $R_Info[3] = $Read_ZipCode
    $R_Info[4] = $Read_City
    ; Sender
    $R_Info[5] = $Sender_CompanyName ; Sender Name, DeHex'ed
    $R_Info[6] = $Sender_Address1 ; Sender Address 1 DeHex'ed
    $R_Info[7] = $Sender_Address2 ; Sender Address 2 DeHex'ed
    $R_Info[8] = $Sender_zip ; Sender Zip DeHex'ed
    $R_Info[9] = $Sender_City ; Sender City DeHex'ed

    $R_Info[10] = _NowDate() ; Replaces the DATE with today's date
    $R_Info[11] = $Read_OrdreNr
    $R_Info[12] = $Read_KoNr
    $R_Info[13] = $Read_Info_Date_Picker
    $R_Info[14] = $Read_TimeDel
    $R_Info[15] = $Read_Comment
    ; Goods information
    $RCustomer[0] = $Read_Info_Customer
    $RCollieCount[0] = $Read_Info_CollieCount
    $RCollieType[0] = $Read_Info_CollieType
    $RWeight[0] = $Read_Info_CollieWeight
    If $Read_Add_OrdreNr = "" Then ; Check if addational ordre numbers is typed
        $ROrdre[0] = $Read_OrdreNr ; If not we copy the "main" ordre number
    Else
        $ROrdre[0] = $aStrings[0] ; Else we set the first sting
    EndIf
    If $Read_Add_KoNr = "" Then ; Check if addational ordre numbers is typed
        $RKoNr[0] = $Read_KoNr ; If not we copy the "main" ko number
    Else
        $RKoNr[0] = $aKStrings[0] ; Else we set the first sting
    EndIf

    ;Func _WriteFreight()
    ; Replace Part /-> Creating a loop to search and replace info in the html file

    $ii = 0
    While $ii <= 15
;~  Do ; Info Part
        ;MsgBox(0, "Find og udskift", "filen der skiftes i = " &$filename & " Find = " & $F_Info[$i] & " Udskift med = " & $R_Info[$i], 2)
        $retval = _ReplaceStringInFile($filename, $F_Info[$ii], $R_Info[$ii], 1, 0)
        $ii = $ii + 1
        $Persent = ($ii / 15) * 100
        ProgressSet($Persent, "Skriver Fragtbrev")
;~  Until $ii = 15
    WEnd
    If $Html = 2 Then ; If we have to freight letters we do a replace in the last one to
        $ii = 0
        While $ii <= 15
;~  Do ; Info Part
            $retval = _ReplaceStringInFile($filename, $F_Info[$ii], $R_Info[$ii], 1, 0)
            $ii = $ii + 1
;~  Until $ii = 15
        WEnd
    EndIf
    $Read_TimeDel = "" ; /-> resetting Time Del.
    $Read_Comment = "" ; /-> resetting Comment.

;Stats
    
    If $Html = 1 Then $Max = 16 ; Check if we need more then 1 freightletter
    $i = 0
    Local $s = 0
    While $i <= $Max - 1

        $Stats = IniReadSection($Settings, "STATS") ; Read stats
        If $s = 0 Then ; We only need to run the loop ones, so when $s is set, we jump this
            $s = 1
            While $s <= 19 - 1 ; Runing thru the stats to finde the correct day to fill

                If $Stats[$s][0] = $StatDay & "_PLL" Then ; Runs thru the array until we have a match, and then exits the loop
                    ExitLoop
                EndIf
                $s = $s + 1
            WEnd
        EndIf

        $FCustomer[$i] = "CUSTOMER_" & $i
        ;MsgBox(0, " Customer", $FCustomer[$i] & "CUSTOMER_" & $i, 3)
        $FCollieCount[$i] = "CL_" & $i
        $FWeight[$i] = "WEIGH_" & $i
        $FCollieType[$i] = "T_" & $i
        $FOrdre[$i] = "ORDRE_NUMBERS_" & $i
        $FKoNr[$i] = "KO_NUMBERS_" & $i

        $retval = _ReplaceStringInFile($filename, $FCustomer[$i], $RCustomer[$i], 1, 0)
        $retval = _ReplaceStringInFile($filename, $FCollieCount[$i], $RCollieCount[$i], 1, 0)
        $retval = _ReplaceStringInFile($filename, $FCollieType[$i], $RCollieType[$i], 1, 0)
        $retval = _ReplaceStringInFile($filename, $FWeight[$i], $RWeight[$i], 1, 0)
        $retval = _ReplaceStringInFile($filename, $FOrdre[$i], $ROrdre[$i], 1, 0)
        $retval = _ReplaceStringInFile($filename, $FKoNr[$i], $RKoNr[$i], 1, 0)
        ; Check if collie type is PLL & CLL so we can write it the correct in stats
        If $RCollieType[$i] <> "" Then
            If $RCollieType[$i] = "PLL" Then

                IniWrite($Settings, "STATS", $StatDay & "_PLL", $Stats[$s][1] + $RCollieCount[$i])
                IniWrite($Settings, "STATS", "WEEK_PLL", $Stats[23][1] + $RCollieCount[$i]) ; writes to Week
                IniWrite($Settings, "STATS", "MONTH_PLL", $Stats[27][1] + $RCollieCount[$i]) ; Writes to Month
                IniWrite($Settings, "STATS", "All_PLL", $Stats[30][1] + $RCollieCount[$i]) ; Writes to ALL
            Else

                IniWrite($Settings, "STATS", $StatDay & "_CLL", $Stats[$s + 1][1] + $RCollieCount[$i])
                IniWrite($Settings, "STATS", "WEEK_CLL", $Stats[24][1] + $RCollieCount[$i]) ; writes to Week
                IniWrite($Settings, "STATS", "MONTH_CLL", $Stats[28][1] + $RCollieCount[$i]) ; Writes to month
                IniWrite($Settings, "STATS", "ALL_CLL", $Stats[31][1] + $RCollieCount[$i]) ; Writes to all
            EndIf
        EndIf
        IniWrite($Settings, "STATS", $StatDay & "_KG", $Stats[$s + 2][1] + $RWeight[$i]) ; Writes to day
        IniWrite($Settings, "STATS", "WEEK_KG", $Stats[25][1] + $RWeight[$i]) ; Writes to Week
        IniWrite($Settings, "STATS", "MONTH_KG", $Stats[29][1] + $RWeight[$i]) ; Writes to Month
        IniWrite($Settings, "STATS", "ALL_KG", $Stats[32][1] + $RWeight[$i]) ; Writes to ALL
        $i = $i + 1
        $Persent = ($i / $Max) * 100
        ProgressSet(Round($Persent), "Skriver Fragtbrev")

    WEnd
    _ReplaceStringInFile($filename, "USER", _StringEncrypt(0, $ReadUser, $Code, 3), 1, 0) ; replaces USER in Html with User name read from login.

$PdfSettings = IniRead($Settings, "PDF", "Enable", "4")

If $PdfSettings = 1 Then
ProgressSet(100, "Konverter Fragtbrev til pdf")
    $Path = IniRead($Settings, "PDF", "Path", @ScriptDir & "\Lib\2pdf.exe")
    ;ClipPut("PATH = " & $Path & ' "' & $filename & '" "' & $FreightSave)
    Run($Path & ' "' & $filename & '" "' & $FreightSave, "", @SW_HIDE)
    ;Run(@ScriptDir & '\Lib\2pdf.exe "' & $filename & '" "' & $FreightSave, "", @SW_HIDE)
    Dim $szDrive, $szDir, $szFName, $szExt
    $PdfExe = _PathSplit($Path,$szDrive, $szDir, $szFName, $szExt)
    ;ClipPut($PdfExe[3] & $PdfExe[4])
    ProcessWaitClose("2pdf.exe")
    If FileExists($FreightSave) Then
        ProgressSet(100, "Fragtbrevet er blevet genereret")
        Sleep(1000)
        FileDelete($SaveIN & '\*.html') ;Cleaning up html file
        ProgressOff() ; Closes the progress

        $TotalCollie = "" ; Clears total Collie
        $TotalWeight = "" ; Clears total Weight

        While $i <= $Max - 1 ; Clearing all temp var's
            $FCustomer[$i] = ""
            $FCollieCount[$i] = ""
            $FWeight[$i] = ""
            $FCollieType[$i] = ""
            $FOrdre[$i] = ""
            $FKoNr[$i] = ""
        WEnd

        GUISetState(@SW_ENABLE, $Booking)
        _FileWriteMyLog($LogFile, "Fragtbrev: Konverterede " & $filename & " til pdf")
    Else
        ProgressOff() ; Closes the progress
        GUISetState(@SW_ENABLE, $Booking)
        _FileWriteMyLog($LogFile, "Fragtbrev: FEJL -> " & $filename & " kunne ikke konvateres til pdf")
        MsgBox(266256, "Fragtbrev", "Fragtbrevet kunne ikke konveteres til pdf" & @CRLF & @CRLF & "Den midlertidigt genereret html fil Ã¥bnes nu" & @CRLF & "i en browser, hvor fra den kan udskrives.")
        ShellExecute($filename)
    EndIf
Else
    Dim $szDrive, $szDir, $szFName, $szExt
    $HtmlSave = _PathSplit($FreightSave,$szDrive, $szDir, $szFName, $szExt)
    FileCopy($Filename,$HtmlSave[1] & $HtmlSave[2] & $HtmlSave[3] & ".html")
    ;ShellExecute($filename)
    GUISetState(@SW_ENABLE, $Booking)
    EndIf
    ; Resetting
    $Html = 1
    $Total = 0
    $KTotal = 0
    $TotalCollie = 0
    $TotalWeight = 0
    $s = 0
    _FileWriteMyLog($LogFile, "Fragtbrev: Generering af fragtbrev afsluttet")
EndFunc   ;==>_WriteHTML

Func _Tab_Info()
    ; Split/Next line after :-> 123456-123456-123456-123456-123456-123456-123456-123456- // 56 Char's and put it into seperat strings
    ; This one i got from the forum (http://www.autoitscript.com/forum/index.php?showtopic=108384).
    ; Thx jchd
    Local $String = $Read_Add_OrdreNr
    Local $KString = $Read_Add_KoNr
    Local $len = StringLen($String)
    Local $Klen = StringLen($KString)
    If $Read_Add_OrdreNr <> "" Then ; Some error check
        Local Const $limit = 56
        Local $nbStr = Floor(($len + $limit - 1) / $limit)
        Local $aStrings[$nbStr]
        For $i = 0 To $nbStr - 1
            $aStrings[$i] = StringLeft($String, $limit)
            $String = StringTrimLeft($String, $limit)
        Next
    Else
        $len = StringLen($Read_OrdreNr)
    EndIf

    If $Read_Add_KoNr <> "" Then ; Some error check
        Local Const $Klimit = 56
        Local $nbStr = Floor(($Klen + $Klimit - 1) / $Klimit)
        Local $aKStrings[$nbStr]
        For $i = 0 To $nbStr - 1
            $aKStrings[$i] = StringLeft($KString, $Klimit)
            $KString = StringTrimLeft($KString, $Klimit)
        Next
    Else
        $Klen = StringLen($Read_KoNr)
    EndIf

    If $len or $Klen = "223" Then
        $Total = 5

        $ROrdre[1] = $aStrings[1] ; Ordre Number 2
        $ROrdre[2] = $aStrings[2] ; Ordre Number 3
        $ROrdre[3] = $aStrings[3] ; Ordre Number 4

        $RKoNr[1] = $aKStrings[1] ; Ordre Number 2
        $RKoNr[2] = $aKStrings[2] ; Ordre Number 3
        $RKoNr[3] = $aKStrings[3]
    ElseIf $len or $Klen > "168" Then
        $Total = 5
        $ROrdre[1] = $aStrings[1] ; Ordre Numbers 2
        $ROrdre[2] = $aStrings[2] ; Ordre Numbers 3
        $ROrdre[3] = $aStrings[3] ; Ordre Number 4

        $RKoNr[1] = $aKStrings[1] ; Ordre Number 2
        $RKoNr[2] = $aKStrings[2] ; Ordre Number 3
        $RKoNr[3] = $aKStrings[3]
    ElseIf $len Or $Klen > "112" Then
        $Total = 4
        $ROrdre[1] = $aStrings[1] ; Ordre Numbers
        $ROrdre[2] = $aStrings[2] ; Ordre Numbers

        $RKoNr[1] = $aKStrings[1] ; Ordre Number 2
        $RKoNr[2] = $aKStrings[2] ; Ordre Number 3

    ElseIf $len > "56" Then
        $Total = 3
        $ROrdre[1] = $aStrings[1] ; Ordre Numbers

        $RKoNr[1] = $aKStrings[1] ; Ordre Number 2
    Else
        $Total = 2
    EndIf



    $TotalCollie = $TotalCollie + $Read_Info_CollieCount
    $TotalWeight = $TotalWeight + $Read_Info_CollieWeight

EndFunc   ;==>_Tab_Info

Func _Tab_F1_C1()

    If $1_Customer1 <> "" Then
    $sl = StringLen($1_OrdreNr1)
    $kl = StringLen($1_KoNr1)
    If $sl > $kl Then
        Local $String = $1_OrdreNr1
    Else
        Local $String = $1_KoNr1
    EndIf

        Local $len = StringLen($String)
        If $1_KoNr1 <> "" Then ; Some error check
            Local Const $limit = 56
            Local $nbStr = Floor(($len + $limit - 1) / $limit)
            Local $aStrings[$nbStr]
            For $i = 0 To $nbStr - 1
                $aStrings[$i] = StringLeft($String, $limit)
                $String = StringTrimLeft($String, $limit)
            Next
        EndIf


        If $len = "223" Then
            $y = $Total - 1
            $RCustomer[$y] = $1_Customer1
            $RCollieCount[$y] = $1_CollieCount1
            $RCollieType[$y] = $1_CollieType1
            $RWeight[$y] = $1_CollieWeight1
            ; Sets Ordre Numbers
            $ROrdre[$y] = $aStrings[0]
            $ROrdre[$y + 1] = $aStrings[1]
            $ROrdre[$y + 2] = $aStrings[2]
            $ROrdre[$y + 3] = $aStrings[3]
            $Total = $Total + 4
        ElseIf $len > "168" Then
            $y = $Total - 1
            $RCustomer[$y] = $1_Customer1
            $RCollieCount[$y] = $1_CollieCount1
            $RCollieType[$y] = $1_CollieType1
            $RWeight[$y] = $1_CollieWeight1
            ; Sets Ordre Numbers
            $ROrdre[$y] = $aStrings[0]
            $ROrdre[$y + 1] = $aStrings[1]
            $ROrdre[$y + 2] = $aStrings[2]
            $ROrdre[$y + 3] = $aStrings[3]
            $Total = $Total + 4
        ElseIf $len > "112" Then
            $y = $Total - 1
            $RCustomer[$y] = $1_Customer1
            $RCollieCount[$y] = $1_CollieCount1
            $RCollieType[$y] = $1_CollieType1
            $RWeight[$y] = $1_CollieWeight1
            ; Sets Ordre Numbers
            $ROrdre[$y] = $aStrings[0]
            $ROrdre[$y + 1] = $aStrings[1]
            $ROrdre[$y + 2] = $aStrings[2]
            $Total = $Total + 3
        ElseIf $len > "56" Then
            $y = $Total - 1
            $RCustomer[$y] = $1_Customer1
            $RCollieCount[$y] = $1_CollieCount1
            $RCollieType[$y] = $1_CollieType1
            $RWeight[$y] = $1_CollieWeight1
            ; Sets Ordre Numbers
            $ROrdre[$y] = $aStrings[0]
            $ROrdre[$y + 1] = $aStrings[1]
            $Total = $Total + 2
        Else
            $y = $Total - 1
            $RCustomer[$y] = $1_Customer1
            $RCollieCount[$y] = $1_CollieCount1
            $RCollieType[$y] = $1_CollieType1
            $RWeight[$y] = $1_CollieWeight1
            ; Sets Ordre Numbers
            $ROrdre[$y] = $aStrings[0]
            $Total = $Total + 1
        EndIf
        $TotalCollie = $TotalCollie + $1_CollieCount1
        $TotalWeight = $TotalWeight + $1_CollieWeight1
    EndIf

EndFunc   ;==>_Tab_F1_C1

; Goes down till Tab_F3_C5

Sry for posting this large script, but as sayed i have no idea how to translate my prob to english.

but i hope the code helps a little, the $KString is the new part i have to add to my html.

Say the word and ill post the html code to, if it could clearyfy some thing :blink:

Cheers

/Rex

:Edit TypO

Edited by Rex
Link to comment
Share on other sites

Im going to remove the S&R part, and generate the html from with in autoit - the S&R part takes forever as of now and with the add input field it will take ages :blink: but still it doe's not help me with the if 1<2 the allocate space after the large input and fill with blanks for the rest in short input.

Result:

I found this thread http://www.autoitscript.com/forum/index.php?showtopic=118154&st=0&p=822986&fromsearch=1&#entry822986

and impl. that into my script writing the html from that.

To check the string to get the larges i used Ubound(array) to solve my prob.

So now all works like a charm ;)

Thx all.

Cheers

/Rex

:Edit End of story :P

Edited by Rex
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...