
AMFC
Members-
Posts
12 -
Joined
-
Last visited
Everything posted by AMFC
-
Hi, I have incorporated a small improvement to an existing utility. This is a small utility to select System fonts and easily put the corresponding instruction in a Script. In the popup window, select the font you need and then use [Ctrl] + [v] to paste the instruction code into the corresponding line of your Script. This is a very simple utility, but I find it very useful. ;*************************************************************************** ; Utilidad para mostrar las FUENTES existentes en el Sistema y construir ; directamente la instrucción AUTOIT que debe escribirse en la Script. ; La instrucción se guarda en el PORTAPAPELES y se puede volcar en la Script ; con: [Ctrl] + [v] ; ; Antonio Fernandez Corcobado ;*************************************************************************** #include <Misc.au3> Global $Fuente Global $Instruccion While 1 $Fuente = _ChooseFont() If (@error) Then Exit Else $Instruccion = 'GUICtrlSetFont(-1,'&$Fuente[3]&','&$Fuente[4]&','&$Fuente[1]&',"'&$Fuente[2]&'")' ClipPut($Instruccion) $txt = "Font Name: " & $Fuente[2] & @CRLF & @CRLF $txt&= "Size: " & $Fuente[3] & @CRLF $txt&= "Weight: " & $Fuente[4] & @CRLF & @CRLF $txt&= "Attributes: " & $Fuente[1] & @CRLF& @CRLF $txt&= "COLORREF rgbColors: " & $Fuente[5] & @CRLF $txt&= "Hex BGR Color: " & $Fuente[6] & @CRLF $txt&= "Hex RGB Color: " & $Fuente[7] MsgBox(0, "",$txt) EndIf WEnd Exit
-
Perdón por este post en español. Espero que el traductor Google pueda traducir mi agradecimiento. Durante la primera década de este siglo, en mi trabajo, tenía la necesidad de controlar sesiones host de AS/400 desde mi PC. Hacia trabajos muy concretos y repetitivos pero imprescindibles en mi empresa. Para ayudarme en esta misión busqué software que me permitiera controlar programas en el PC de una forma fácil. Experimenté con varios, pero el que me daba más opciones de control era AUTOIT. Desde el año 2000 yo he crecido y Autoit también. Hoy hay pocas cosas en un PC que yo no sea capaz de automatizar a través de Autoit y en mi empresa estoy bien considerado por ello. Muchas veces he querido enviar mi agradecimiento al Sr. Jon y a los colaboradores que con su ingenio y perseverancia han hecho de este lenguaje una potente herramienta en el mundo informático. GRACIAS JON. ----------------------------------------------- Sorry for this post in Spanish. I hope the Google translator can translate my thanks. During the first decade of this century, in my work, I had the need to control AS / 400 host sessions from my PC. Towards very specific and repetitive but essential jobs in my company. To help me in this mission I looked for software that would allow me to control programs on the PC in an easy way. I experimented with several, but the one that gave me the most control options was AUTOIT. Since 2000 I have grown and so has Autoit. Today there are few things on a PC that I am not able to automate through Autoit and in my company I am well regarded for that. Many times I have wanted to send my thanks to Mr. Jon and to the collaborators who with their ingenuity and perseverance have made this language a powerful tool in the computing world. THANK YOU JON.
-
For many months I have searched for the correct writing to be able to use a conditional formatting in an Excel, but looking for a condition on cells with text not with numbers. After many tests, fortunately I discovered the secret yesterday. The correct syntax is not the same as for numbers. In the case of text it is like this: ;*********************************************************************************** ; Ejemplo que rellena un rango con valores y luego le aplica un Formato Condicional ; siguiendo criterios de TEXTO. ; Autor: Antonio Miguel Fernandez ;*********************************************************************************** #include <Excel.au3> ; Que en los textos de las celdas se encuentre la letra J $BUSCAR= "j" ; Crear el Objeto Excel y presentarlo al usuario Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookNew($oExcel) ; Rellena el rango de celdas con distintos valores For $i = 1 To 10 Step 1 _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "00"&$i, "A"&$i) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "Name0"&$i, "B"&$i) $Texto = Aleatorio() _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $Texto, "C"&$i) $Texto = Aleatorio() _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $Texto, "D"&$i) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "10000"&$i, "E"&$i) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "=SUMA(A"&$i&";E"&$i&")", "F"&$i) Next ; Da formato al rango Global Const $xlDouble = -4119 ; Borde de celdas con lineas dobles. With $oExcel.ActiveWorkbook.Sheets(1) .Range("A:E").Font.Color = 0x111111 .Range("A:E").Font.Size = 9 .Range("A:M").Font.Name = "Arial" .Range("F1:F10").Borders.LineStyle = $xlDouble EndWith ; Creando las condiciones a verificar. $oExcel.Range("B1:D10").Select ; Rango donde aplicar el formato. ;$oExcel.Selection.FormatConditions.Delete ; Borrar los posibles formatos que hubiera en estas seleccion anteriormente. ; Formato condicional dependiendo del TEXTO que hay en las celdas. Local Const $xlTextString=9 ;Cadena de texto ;-------------------------------------------------------- Local Const $xlBeginsWith=2 ;Begins with a specified value. Local Const $xlContains=0 ;Contains a specified value. Local Const $xlDoesNotContain=1 ;Does not contain the specified value. Local Const $xlEndsWith=3 ;Endswith the specified value ;*************************************************************************** $oExcel.Selection.FormatConditions.Add($xlTextString,Default,Default,Default,$BUSCAR,$xlContains,Default,Default) ;*************************************************************************** $oExcel.Selection.FormatConditions($oExcel.Selection.FormatConditions.Count).SetFirstPriority With $oExcel.Selection.FormatConditions(1).Font .Color = -16383844 .TintAndShade = 0 EndWith With $oExcel.Selection.FormatConditions(1).Interior .PatternColorIndex = -4105 ;xlAutomatic .Color = 13551615 .TintAndShade = 0 EndWith $oExcel.Selection.FormatConditions(1).StopIfTrue = False Func Aleatorio() Local $sText = "" For $i = 1 To Random(5, 20, 1) ; Return an integer between 5 and 20 to determine the length of the string. $sText &= Chr(Random(65, 122, 1)) ; Return an integer between 65 and 122 which represent the ASCII characters between a (lower-case) to Z (upper-case). Next Return $sText EndFunc
-
Thanks Aiter and Zedna. I have finally found a way to solve my problem... The Taitel method works perfectly, although its graph is 3D instead of 2D
- 9 replies
-
- graphgdiplus
- 2d graphics
-
(and 1 more)
Tagged with:
-
Is this your suggestion?... ;********************************************************************* ; How to put a 2D graphic inside Tabs ? ;********************************************************************* #include <GraphGDIPlus_UDF.au3> #include <GuiConstantsEx.au3> $ID0 = GUICreate("TEST 2D Graphic",1000,600) $idTabCAB = GUICtrlCreateTab(10,10,980,500) ; TabItem definition ************************ $TAB1 = GUICtrlCreateTabItem(" TAB 1 ") GUICtrlCreateLabel("First Tab. The graphic should not be seen.",50,70,400,25) ;--------------------------------------- $TAB2 = GUICtrlCreateTabItem(" TAB 2 ") GUICtrlCreateLabel("Second Tab. The graph must be seen.",50,70,400,25) GUICtrlSetState($TAB2, $GUI_SHOW); <<<<<<<<<<<<<<<<<<<<<<<<<<<< will be display first GUICtrlCreateLabel("Title of the graphic",520,70,400,25) GUICtrlSetFont(-1,10,800,0,"Arial Narrow") $Graph = _GraphGDIPlus_Create($ID0,520,100,400,200,0xFF000000,0xFFE0F0FF) _GraphGDIPlus_Set_RangeX($Graph,1,52,25,1,0) _GraphGDIPlus_Set_RangeY($Graph,0,100,10,1,0) ;----- Trace the curve ----------------- TraceCurve() ;--------------------------------------- $TAB3 = GUICtrlCreateTabItem(" TAB 3 ") GUICtrlCreateLabel("Third Tab. The graphic should not be seen.",50,70,400,25) ;*********************************************** GUICtrlCreateTabItem(""); end tabitem definition GUISetState() While 1 Local $msg = GUIGetMsg() Select Case $msg = -3 ;[Exit] ExitLoop EndSelect WEnd ;----- close down GDI+ and clear graphic ----- _GraphGDIPlus_Delete($ID0,$Graph) GUISetState(@SW_HIDE) Exit
- 9 replies
-
- graphgdiplus
- 2d graphics
-
(and 1 more)
Tagged with:
-
Thank you very much JOS.
- 9 replies
-
- graphgdiplus
- 2d graphics
-
(and 1 more)
Tagged with:
-
Please, forgive my mistake. You're so kind to tell me where to put it.
- 9 replies
-
- graphgdiplus
- 2d graphics
-
(and 1 more)
Tagged with:
-
Hello everyone, For a measurement application, I need to put a 2D graphic inside a tab control (inside the second tab). But I can’t get the graph to appear only in the second tab. Please, what am I doing wrong? #include <GraphGDIPlus_UDF.au3> $ID0 = GUICreate("TEST 2D Graphic",1000,600) $idTabCAB = GUICtrlCreateTab(10,10,980,500) ; TabItem definition ************************ $TAB1 = GUICtrlCreateTabItem(" TAB 1 ") GUICtrlCreateLabel("First Tab.",50,70,400,25) ;--------------------------------------- $TAB2 = GUICtrlCreateTabItem(" TAB 2 ") GUICtrlCreateLabel("Second Tab.",50,70,400,25) GUICtrlCreateLabel("Title of the graphic",520,70,400,25) GUICtrlSetFont(-1,10,800,0,"Arial Narrow") $Graph = _GraphGDIPlus_Create($ID0,520,100,400,200,0xFF000000,0xFFE0F0FF) _GraphGDIPlus_Set_RangeX($Graph,1,52,25,1,0) _GraphGDIPlus_Set_RangeY($Graph,0,100,10,1,0) ;----- Trace the curve ----------------- TraceCurve() ;--------------------------------------- $TAB3 = GUICtrlCreateTabItem(" TAB 3 ") GUICtrlCreateLabel("Third Tab.",50,70,400,25) ;*********************************************** GUICtrlCreateTabItem(""); end tabitem definition GUISetState() While 1 Local $msg = GUIGetMsg() Select Case $msg = -3 ;[Exit] ExitLoop EndSelect WEnd ;----- close down GDI+ and clear graphic ----- _GraphGDIPlus_Delete($ID0,$Graph) GUISetState(@SW_HIDE) Exit Func TraceCurve() _GraphGDIPlus_Set_PenColor($Graph,0xFF0084FF) _GraphGDIPlus_Set_PenSize($Graph,2) _GraphGDIPlus_Plot_Start($Graph,0,0) For $X=1 to 52 Step 1 $Y = Random(1,100,1) ; Random values for example. _GraphGDIPlus_Plot_Line($Graph,$X,$Y) _GraphGDIPlus_Refresh($Graph) Next EndFunc Someone is so kind to help me. This is my script. thank you very much in advance.
- 9 replies
-
- graphgdiplus
- 2d graphics
-
(and 1 more)
Tagged with:
-
I'm in a similar situation. I connect to a DB2 database on an AS / 400 machine. Everything works, but I do not know the result of my UPDATE transactions if it is not interrogating each time for the value of the modified row. I tried to ask $SQLRS.State or $SQLRS.Status, but it does not work. Can someone please help? Thank you very much. ;*************************************************************** ; How to read Return Code from AS/400 DB2 SQL UPDATE transaction?. ;*************************************************************** ; ODBC error control $oErrorHandler = ObjEvent("AutoIt.Error", "objError") ; TABLE CONNECTION $SQLCON=ObjCreate("ADODB.Connection") If @error Then $SQLCON.Close $SQLCON.Mode= 16 ;Shared $SQLCON.CursorLocation=2 ;Client Side cursor $SQLCON.ConnectionTimeout=10 $SQLCON.Open ("DSN=XXX.XXX.XXX.XXX;UID='User1';PWD='Password1';) If @error Then MsgBox(16,"Test","Fail conexion.") $SQLCON.Close Exit EndIf ; UPDATE TEST $SQLRS = ObjCreate("ADODB.Recordset") If Not @error Then $SQLRS.Open("update MY_TABLE set COLUMN2='modificated' where COLUMN2='initial data",$SQLCON) EndIf MsgBox(48,"Return Code","State: "&$SQLRS.State&@CRLF&"Status: "&$SQLRS.Status) $SQLCON.Close Exit Func objError($oError) $T ="Num.Error : " & $oError.number & @CRLF $T&="Description : " & $oError.windescription & @CRLF & @CRLF $T&=$oError.description & @CRLF & @CRLF & @CRLF $T&="Helpfile : " & $oError.helpfile & @CRLF $T&="helpcontext : " & $oError.helpcontext & @CRLF $T&="lastDLLerror: " & $oError.lastdllerror & @CRLF & @CRLF& @CRLF $T&="Script Line: " & $oError.scriptline & @CRLF $T&="Ret.Code : " & $oError.retcode MsgBox(48,"Error Rutine",$T) EndFunc *************************************************************