Jump to content

squishy

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by squishy

  1. Thanks for making this great text tool, Valuater! Is there a way that I can shrink/grow the text created with your scripts?
  2. Thanks, Yashied, As I said, I am aware of the workarounds, such as StringFormat. Just thought there should be some consistency in the language itself.
  3. I am having some issues with AutoIt outputting scientific notation as opposed to decimal figures. Here is my problem... 0 + 0.0000001 returns the value in scientific notation (1e-007) anything other than zero added to the value returns the value in decimal form 0.01 + 0.0000001 returns 0.0100001 I know there are workarounds, but shouldn't this be consistent?
  4. Hello! First off, this is a great tool for those of us who use Excel sheets on a regular basis! Thank you! I have a suggestion...what about adding in a sheet variable in all the functions. This would allow us to specify which sheet to write the data, instead of activating it first. Something like the following: Func _ExcelWriteCell($oExcel, $sValue, $sRangeOrRow, $iColumn = 1,$vSheet = 0) If NOT IsObj($oExcel) Then Return SetError(1, 0, 0) If NOT IsNumber($vSheet) Or $vSheet < 0 Or $vSheet > $oExcel.Sheets.Count Then Return SetError(3, 0, 0) If $vSheet = 0 Then $vSheet = $oExcel.Activesheet.Index If NOT StringRegExp($sRangeOrRow, "[A-Z,a-z]", 0) Then If $sRangeOrRow < 1 Then Return SetError(2, 0, 0) If $iColumn < 1 Then Return SetError(2, 1, 0) $oExcel.Sheets($vSheet).Cells($sRangeOrRow, $iColumn).Value = $sValue Return 1 Else $oExcel.Sheets($vSheet).Range($sRangeOrRow).Value = $sValue Return 1 EndIf EndFunc;==>_ExcelWriteCell If you add the $vSheet option at the end of the statement, it won't break any current code. Just a thought for future releases. I am also looking at trying to optimize the array reading/writing, instead of doing it one cell at a time. It can be perfomed in VBA easily, so there has to be a way using AutoIt... Thanks again!
  5. Yes, I did read that the NEXT release would break backwards compatibility...not this release. It goes on to explain why it will break backwards compatibility - GUIConstants.au3/GUIConstantsEx.au3. Once again, lesson learned on my part. And yes, I will (slowly) start to port my scripts over to the new release to gain the new functionality. Perhaps, like Zedna said, a mention of the major change in UDF's - which are included in the install package - would have been a good mention, even if the core AutoIt files weren't affected. Thanks again for everyone's feedback and support. This is one of the best support forums out there!
  6. Greetings! Just wanted to say thank you to you guys for this post...I was banging my head against the wall wondering why everything changed with the new release! I would have to agree with gesller on his comments, though...nowhere in the production version history does it mention that virtually all the GUI stuff has been changed over to incorporate the AU3Lib stuff. After poking around, I see that the beta version history has it listed. I agree that stability is the driving force behind the production versions - which is exactly the reason that many people will only download those versions (especially when you are running critical programs). I think a small warning - or at least a mention of the major change - in the history would prove to be beneficial to those people (me included). A lesson learned for me, I guess...now to start re-coding my 10,000 line script...
  7. I now see that my problem was not having at least one column. Thanks to Bowmore, gafrost and jpm!
  8. Hello, I upgraded to the new version tonight and after running my script, my listviews wouldn't show up in the GUI anymore. Here is a sample of the code... $lvJMMainPositionFunctions = GUICtrlCreateListView("",15, 170, 240, 420, BitOR($LVS_LIST,$WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "Tahoma") GUICtrlSetOnEvent(-1, "lvJMMainPositionFunctionsClick") _GUICtrlListViewSetColumnWidth(-1,0,220) GUICtrlSetState(-1, $GUI_HIDE) $lvJMMainPositionPrograms = GUICtrlCreateListView("",270, 170, 240, 420, BitOR($LVS_LIST,$WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "Tahoma") GUICtrlSetOnEvent(-1, "lvJMMainPositionProgramsClick") _GUICtrlListViewSetColumnWidth(-1,0,220) GUICtrlSetState(-1, $GUI_HIDE) And later on in the code, I set the state... GUICtrlSetState($lvJMMainPositionFunctions,$GUI_SHOW) GUICtrlSetState($lvJMMainPositionPrograms,$GUI_SHOW) I saw that in that in this release they "Fixed: Incorrect listview creation with GUICtrlCreateListView()", and I am sure here lies my issue, but couldn't find anything else on the subject. Any help would be appreciated. Thanks in advance!
  9. Thanks, randallc, for the responses! Basically, I need to work on a few different files, all of which are .dbf format. I will need to essentially run queries on each file and return results to custom forms, adding functionality to some outdated software we use. The biggest problem I am running into is the speed factor...the smallest file we work with is around 9 MB, and the largest is over 100 MB. I have tried reading the whole file first, which works fairly quickly, and then the processing slows it down greatly. I didn't think of using vbscript functions...just assumes AutoIt would run them just as fast... Not a problem...just send me a message with an account that can handle a 9MB email attachment... Not sure...it does follow the xbase file format for the header and record formats tho. Once again, thanks for your help! Perhaps we can work together to come up with some mutual solutions! Troy.
  10. Hello! I am trying to read large binary files (specifically, .dbf files) into an array. However, using my current code, this takes FOREVER! I have started learning about using DLLStructs...would using these be any faster when loading each record? Any help would be appreciated... Thanks! #include <File.au3> #include <Date.au3> Local $fDBF,$data,$rsHeader[6],$dLastUpdate,$numfields,$temp,$fielddesc[2],$rsData[2],$x,$y,$numrecs,$numbytesheader,$reclen,$pos,$currecord,$curfield,$t $t = _NowCalc() $fDBF = FileOpen("G:\bvinfo.dbf",16) $data = FileRead($fDBF,32);get header $dLastUpdate = "200" & Asc(BinaryToString(BinaryMid($data,2,1))) & "/" & Asc(BinaryToString(BinaryMid($data,3,1))) & "/" & Asc(BinaryToString(BinaryMid($data,4,1))) $numrecs = Dec(Hex(BinaryMid($data,8,1) & BinaryMid($data,7,1) & BinaryMid($data,6,1) & BinaryMid($data,5,1))) $numbytesheader = Dec(Hex(BinaryMid($data,10,1) & BinaryMid($data,9,1))) $numfields = Int(Dec(Hex(BinaryMid($data,10,1) & BinaryMid($data,9,1))) / 32) - 1 $reclen = Dec(Hex(BinaryMid($data,12,1) & BinaryMid($data,11,1))) ReDim $fielddesc[$numfields+1][6] $pos = 32 For $x = 1 To $numfields;load field descriptions $data = FileRead($fDBF,32) $fielddesc[$x][0] = BinaryToString(BinaryMid($data,1,11));field name $fielddesc[$x][1] = BinaryToString(BinaryMid($data,12,1));field type $fielddesc[$x][2] = BinaryToString(BinaryMid($data,13,4));data address $fielddesc[$x][3] = Asc(BinaryToString(BinaryMid($data,17,1)));field length $fielddesc[$x][4] = BinaryToString(BinaryMid($data,18,1));decimal count ;$fielddesc[$x][5] = BinaryToString(BinaryMid($data,19,14));junk $pos = $pos + 32 Next ReDim $rsData[$numrecs+1][$numfields+1] $data = FileRead($fDBF,$numbytesheader - $pos);seek to beginning of data For $x = 1 To $numrecs $rsData[$x][0] = BinaryToString(FileRead($fDBF,$reclen)) If StringLeft($rsData[$x][0],1) <> "*" Then;active record $pos = 2;set start of data (first pos is deleted field) For $y = 1 To $numfields $curfield = StringMid($rsData[$x][0],$pos,$fielddesc[$y][3]) Switch $fielddesc[$y][1] Case "D";date $rsData[$x][$y] = StringLeft($curfield,4) & "/" & StringMid($curfield,5,2) & "/" & StringRight($curfield,2) Case "C";char $rsData[$x][$y] = StringStripWS($curfield,3) Case "N";numeric $rsData[$x][$y] = Number($curfield) Case "L";logical $rsData[$x][$y] = ($curfield = "T" Or $curfield = "Y") Case "@";timestamp $rsData[$x][$y] = $curfield Case "I";long $rsData[$x][$y] = $curfield Case "F";float $rsData[$x][$y] = Number($curfield) Case "O";double $rsData[$x][$y] = Number($curfield) Case "M";memo $rsData[$x][$y] = $curfield EndSwitch $pos = $pos + $fielddesc[$y][3] Next EndIf Next MsgBox(0,"Time Diff",_DateDiff("s",$t,_NowCalc()));display time to load file FileClose($fDBF) Troy.
  11. Hello! I am having a problem viewing the contents of my combo box...my code works fine under Windows XP, but I tried running the script in Windows 2000, and all the items in my list are gone. Any clues? ECG_Tracker_1.09.au3
×
×
  • Create New...