topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
use FLOCK() | Eduardo,
Did you mean file locks or record locks?
Either way, I use database objects. I wrote a subclass to TDatabase which adds many enhancements.
I added some enhancements for record locking including automatic retries if a record is already locked. Personally, I aways use optimistic locking so a record is only locked for a second, so locked records are not really an issue.
I rarely use file locking and I have not really needed to know who has a file locked. I am interested in this topic since it would be easy to add this feature to my database class. For anyone currently using a database class, this would then only require a recompile to add the new feature to an existing program. This is one of the great advantages of using classes.
If you are interested in more info about my TData class go here:
<!-- m --><a class="postlink" href="http://gointellitech.com/program.htm">http://gointellitech.com/program.htm</a><!-- m -->
James |
use FLOCK() | [quote="James Bott":p2t5gubk]The problem is that as long as the computer is frozen, no one else on the network can access the locked file(s).
I'm not [/quote:p2t5gubk]
what is a blocked file ? Is it a file opened in shared mode ? |
use FLOCK() | You used the term "blocked," I used the term "locked." I presumed by blocked you meant locked. They are very similar. A locked file blocks write access. Maybe this is a language translation thing.
From the Clipper help file:
[quote:2q57iikm]
FLOCK() is a database function used in network environments to lock an
open and shared database file, preventing other users from updating the
file until the lock is released. Records in the locked file are
accessible for read-only operations.
[/quote:2q57iikm]
I am getting the impression that I offended you, Hmpaquito, and if so, it was not intentional. I was just asking about the hang issue to find out how you handled it. I appreciate you sharing your code, and I was not criticizing it.
So, if I did offend you, I apologize.
James |
use FLOCK() | File locks are issued all the time behind the scenes. Every skip on a shared dbf with an index locks the index file until after skip is complete. This is to ensure that the index tree has not changed until after the next record is resolved. Having the locks cached is not the best idea when each users machine is managing the indexes. If you are using client/server then there is no problem. |
use FLOCK() | [quote:2mihguip]
I am getting the impression that I offended you[/quote:2mihguip]
no problem at all
My before code shows how to file system handle can lock or only mark as used... all depend... the key is how use it. Other key is open files of named system 'in use mark' in fopen shared mode. This permit to other users collect info from all users. |
use Firebird SQL | there is any class to use Firebird SQL ? |
use Firebird SQL | [quote="kajot":1sj92mxq]there is any class to use Firebird SQL ?[/quote:1sj92mxq]
Of course is . If you are working with Harbour , then in harbour sources/contrib directory can find hbfbird and sddfb folders . With sources and samples . One good way is to use ADO /OLE DB - though to find freeware things for such purposes it's true ... <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
use Firebird SQL | I am using xHarbour.com |
use Firebird SQL | [quote="kajot":2cndxvj3]I am using xHarbour.com[/quote:2cndxvj3]
Strange ... I thought that xHarbour.com have own SQLRDD and support all populars SQL's . Why you can't to ask this question in xHarbour.com forum ? |
use Icon from Windows DLL Resource | hi,
i have this under Xbase++
[code=fw:1ig87wrv]<div class="fw" id="{CB}" style="font-family: monospace;"> ::<span style="color: #000000;">IcoUp</span> := DXE_Icon<span style="color: #000000;">(</span><span style="color: #000000;">)</span> :<span style="color: #00C800;">new</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> :<span style="color: #000000;">create</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">IcoUp</span>:<span style="color: #000000;">load</span><span style="color: #000000;">(</span> WinDir+<span style="color: #ff0000;">"<span style="color: #000000;">\S</span>ystem32<span style="color: #000000;">\N</span>etShell.dll"</span>, <span style="color: #000000;">2301</span>,<span style="color: #000000;">16</span>,<span style="color: #000000;">16</span> <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">IcoDn</span> := DXE_Icon<span style="color: #000000;">(</span><span style="color: #000000;">)</span> :<span style="color: #00C800;">new</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> :<span style="color: #000000;">create</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">IcoDn</span>:<span style="color: #000000;">load</span><span style="color: #000000;">(</span> WinDir+<span style="color: #ff0000;">"<span style="color: #000000;">\S</span>ystem32<span style="color: #000000;">\N</span>etShell.dll"</span>, <span style="color: #000000;">2300</span>,<span style="color: #000000;">16</span>,<span style="color: #000000;">16</span> <span style="color: #000000;">)</span></div>[/code:1ig87wrv]
these are up/down Arrow for my Listview "Grid" Header
how under Fivewin <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
---
LOADIMAGEFILEICON() seems for "File"-Icon but i want to use Resource "in" DLL
LOADIMAGERESICON() seems to be a Way and also LOADIMAGEICON() but i can not find a Sample |
use Icon from Windows DLL Resource | Not sure, but look at the sample of Mr. Rao.
<!-- l --><a class="postlink-local" href="https://forums.fivetechsupport.com/viewtopic.php?f=3&t=35111">viewtopic.php?f=3&t=35111</a><!-- l -->
<!-- l --><a class="postlink-local" href="https://forums.fivetechsupport.com/viewtopic.php?f=3&t=35281">viewtopic.php?f=3&t=35281</a><!-- l --> |
use Icon from Windows DLL Resource | hi Marc,
thx for Answer
i have to post my Xbase++ "Load"
[code=fw:7nkzlo0a]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">INLINE</span> <span style="color: #00C800;">METHOD</span> Load<span style="color: #000000;">(</span> cDLL, nId, nWidth, nHeight <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> hModule<br /><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">Handle</span> != <span style="color: #000000;">0</span><br /> @user32:<span style="color: #000000;">DestroyIcon</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">Handle</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">IF</span> ValType<span style="color: #000000;">(</span>cDLL<span style="color: #000000;">)</span> == <span style="color: #ff0000;">"C"</span><br /> hModule := @KERNEL32:<span style="color: #000000;">GetModuleHandleA</span><span style="color: #000000;">(</span> cDLL <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> hModule == <span style="color: #000000;">0</span><br /> hModule := @KERNEL32:<span style="color: #000000;">LoadLibraryA</span><span style="color: #000000;">(</span> cDLL <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ELSE</span><br /> hModule := @KERNEL32:<span style="color: #000000;">GetModuleHandleA</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">IF</span> ValType<span style="color: #000000;">(</span>nWidth<span style="color: #000000;">)</span> != <span style="color: #ff0000;">"N"</span><br /> nWidth := <span style="color: #000000;">32</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">IF</span> ValType<span style="color: #000000;">(</span>nHeight<span style="color: #000000;">)</span> != <span style="color: #ff0000;">"N"</span><br /> nHeight := <span style="color: #000000;">32</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> ::<span style="color: #000000;">Handle</span> := @user32:<span style="color: #000000;">LoadImageA</span><span style="color: #000000;">(</span> hModule,;<br /> nId ,;<br /> IMAGE_ICON ,;<br /> nWidth ,;<br /> nHeight ,;<br /> LR_DEFAULTCOLOR <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">GetIconInfo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span>::<span style="color: #000000;">Handle</span><span style="color: #000000;">)</span></div>[/code:7nkzlo0a]
general it use LoadImage() and Constant IMAGE_ICON but also hModule
but how to write a HB_FUNC()
[code=fw:7nkzlo0a]<div class="fw" id="{CB}" style="font-family: monospace;"> Handle = LoadImage<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HINSTANCE <span style="color: #000000;">)</span> hModule, <span style="color: #000000;">(</span>INT<span style="color: #000000;">)</span> nID, IMAGE_ICON, <span style="color: #000000;">(</span>INT<span style="color: #000000;">)</span> nWidth, <span style="color: #000000;">(</span>INT<span style="color: #000000;">)</span> nHeight, LR_DEFAULTCOLOR <span style="color: #000000;">)</span> <span style="color: #000000;">)</span></div>[/code:7nkzlo0a]
or does Fivewin have already a Function for it <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
use Icon from Windows DLL Resource | Maybe, c:\fwh..\samples\LISTVIE1.PRG
or make a complete example. avoid posting pieces of code.
Regards, saludos. |
use Icon from Windows DLL Resource | hi
thx for Answer
Sample c:\fwh\samples\listvie.prg use Icon_Read() which will get "File"-Icon which most are 1st Resource
i want to get Resource Number 2301 from "WinDir+"\System32\NetShell.DLL"
as TGrid() is a new CLASS you need hole CODE for a Demo Sample which now have about 10000 Lines
it might use Technique which Fivewin have not used before
---
the Idea is to use Windows System Icon which "Look" depend on Windows Version
as the same Resource "Number" exist from Windows 98 until Windows 11 you will always get "right" Icon
i found Sample c:\fwh\samples\testigro.prg using ExtractIcon() but i don´t understand "where" Resource come from
btw. how to "create" a Icon like "1 ICON LOADONCALL MOVEABLE DISCARDABLE" in c:\fwh\samples\testigro.rc <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
use Icon from Windows DLL Resource | hi,
got it <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
[code=fw:1c3zz6ni]<div class="fw" id="{CB}" style="font-family: monospace;"> cDLL := WinDir + <span style="color: #ff0000;">"<span style="color: #000000;">\S</span>ystem32<span style="color: #000000;">\N</span>etShell.dll"</span><br /> ::<span style="color: #000000;">hModule</span> := GetModuleHandle<span style="color: #000000;">(</span> cDLL <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">hModule</span> == <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">hModule</span> := LoadLibrary<span style="color: #000000;">(</span> cDLL <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> hIcon := LOADIMAGERESICON<span style="color: #000000;">(</span>::<span style="color: #000000;">hModule</span>, <span style="color: #000000;">2301</span>, <span style="color: #000000;">16</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// hModule, ResID, Size</span></div>[/code:1c3zz6ni]
i was sure that Fivewin have a Function ... but i have to find it ... |
use Icon from Windows DLL Resource | hi,
i got Warnings under MSVC 64 Bit
[quote:137vt8ka]HB_FUNC.PRG(1342): warning C4312: "Typumwandlung": Konvertierung von "int" in größeren Typ "HBITMAP"
HB_FUNC.PRG(1344): warning C4312: "Typumwandlung": Konvertierung von "int" in größeren Typ "HBITMAP"[/quote:137vt8ka]
[code=fw:137vt8ka]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #000000;">1341</span> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> nType > <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><span style="color: #000000;">1342</span> hdItem.hbm = <span style="color: #000000;">(</span>HBITMAP<span style="color: #000000;">)</span> hb_parni<span style="color: #000000;">(</span><span style="color: #000000;">4</span><span style="color: #000000;">)</span> ;<br /><span style="color: #000000;">1343</span> <span style="color: #00C800;">else</span><br /><span style="color: #000000;">1344</span> hdItem.hbm = <span style="color: #000000;">(</span>HBITMAP<span style="color: #000000;">)</span> hb_parni<span style="color: #000000;">(</span><span style="color: #000000;">4</span><span style="color: #000000;">)</span> ;</div>[/code:137vt8ka]
before i had this
[code=fw:137vt8ka]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> nType > <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> hdItem.hbm = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> LoadImage<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HINSTANCE <span style="color: #000000;">)</span> <span style="color: #00C800;">NULL</span>, <span style="color: #0000ff;">TEXT</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"ICOUP"</span> <span style="color: #000000;">)</span> , IMAGE_ICON, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, LR_LOADTRANSPARENT | LR_DEFAULTCOLOR | LR_LOADMAP3DCOLORS | LR_COPYFROMRESOURCE <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">else</span><br /> hdItem.hbm = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> LoadImage<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HINSTANCE <span style="color: #000000;">)</span> <span style="color: #00C800;">NULL</span>, <span style="color: #0000ff;">TEXT</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"ICONDOWN"</span> <span style="color: #000000;">)</span>, IMAGE_ICON, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, LR_LOADTRANSPARENT | LR_DEFAULTCOLOR | LR_LOADMAP3DCOLORS | LR_COPYFROMRESOURCE <span style="color: #000000;">)</span>;</div>[/code:137vt8ka]
---
i do load now Icon from Windows System-Icon and pass it as Parameter Nr. 4 instead to load own Resource
it does run with MSVC 64 Bit but i want to get rid of Warning
how can help me please |
use Icon from Windows DLL Resource | hi,
got it <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
instead of
[code=fw:281rfkx0]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #000000;">1342</span> hdItem.hbm = <span style="color: #000000;">(</span>HBITMAP<span style="color: #000000;">)</span> hb_parni<span style="color: #000000;">(</span><span style="color: #000000;">4</span><span style="color: #000000;">)</span> ;</div>[/code:281rfkx0]
i have to use
[code=fw:281rfkx0]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #000000;">1342</span> hdItem.hbm = <span style="color: #000000;">(</span>HBITMAP<span style="color: #000000;">)</span> hb_parnll<span style="color: #000000;">(</span><span style="color: #000000;">4</span><span style="color: #000000;">)</span> ;</div>[/code:281rfkx0]
Question : is it "safe" use use hb_parnll under 32 Bit <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
use PDF as BMP in printer.prg ? | Hi,
is it possible to manage a PDF file like BMP file ?
I use the oprn:saybitmap(.....) to put BMP file on page and then write what i need.
is possible to do something like oprn:saypdf(...) ?
tks all |
use PDF as BMP in printer.prg ? | Or possible to convert a PDF file (singol page) e in BMP/JPG ?
tks |
use PDF as BMP in printer.prg ? | Romeo,
Once the PDF is shown then we can generate a BMP from it using oWnd:SaveToBmp( cBmpFileName )
I just tried samples\pdf.prg to display a PDF but it is not working. I guess that we need a more recent "AcroPDF.PDF.1" value
Maybe other PDF users could help us here |
use PDF as BMP in printer.prg ? | it works, but i got the full screen with Acrobat Reader Bar & Button
Where can i found the oher method for the activex() ?
Like oActivex:Do("LoadFile"...)
oActivex:Do("SetCurrentPage")
Must exist also something like oActivex:Do("OtherParameters") ?
tks |
use PDF as BMP in printer.prg ? | <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?p=144617#p144617">viewtopic.php?p=144617#p144617</a><!-- l --> |
use PDF as BMP in printer.prg ? | Good !!!
tks Antonio |
use Passwort.Manager for own App ? | hi,
is it possible to use a Password-Manager, like KeePassXC, for own (local) Fivewin App <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
i know KeePassXC search in HTML for "type" and Attribut "password" but how in (lokal) Win32 App <!-- s:idea: --><img src="{SMILIES_PATH}/icon_idea.gif" alt=":idea:" title="Idea" /><!-- s:idea: --> |
use Passwort.Manager for own App ? | hi,
i have ask ChatGPT and he point me to "EnableUIAccess()" which should be a Function in hbWin
but a can´t find it ... does "EnableUIAccess()" exist in harbour <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
use Passwort.Manager for own App ? | Dear Jimmy,
[url:35319kg4]https://www.phind.com/search?q=does+Windows+provide+the+function+EnableUIAccess%28%29+%3F&c=&source=searchbox&init=true[/url:35319kg4] |
use Passwort.Manager for own App ? | hi Antonio ,
[quote="Antonio Linares":183vo0mn][url:183vo0mn]https://www.phind.com/search?q=does+Windows+provide+the+function+EnableUIAccess%28%29+%3F&c=&source=searchbox&init=true[/url:183vo0mn][/quote:183vo0mn]
interesting how phind does Answer
"Keyword" seem to have "highlight" so you can see them easy
i also love right side where it point to Sources so i can "verify" Answer
thx for Tip |
use Result of SQL Query like ""ADODB.Recordset"" | hi,
when using "ADODB.Connection" and "ADODB.Recordset" it is easy to "navigate" as "ADODB.Recordset" have Method for it
Question : what to use with ODBC or "native" <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
"normal" i would say : fill Array with "Result" ... is there a "other" Way <!-- s:idea: --><img src="{SMILIES_PATH}/icon_idea.gif" alt=":idea:" title="Idea" /><!-- s:idea: --> |
use Result of SQL Query like ""ADODB.Recordset"" | Do you mean you want to connect using ODBC driver natively and not through ADO?
You can do it, though it is a thing of the past.
FWH provides
todbc.prg and todbcrdd.prg and more
You can also test TOdbcDirect class in tdbodbcd.prg
To be honest, I tested TOdbc class of FWH some decades back with Oracle and it worked well.
But soon I started using ADO and no going back.
You can try working with the ODBC classes provided by FWH |
use Result of SQL Query like ""ADODB.Recordset"" | As Rao mentions ODBC is a thing of the past .. specifically, lets say I have a corporate SQL application that needs to run on 3000 machines .. that means that (someone ) has to physically go to each of those machines and make sure ODBC is loaded and configured properly .. ADO has no such limitations because oledb comes with every Microsoft operating system and there is no going to every desktop to configure anything ..
ADO is the way to connect to Oracle, SQL Server and to MS Access and more ..
Rick Lipkin |
use Result of SQL Query like ""ADODB.Recordset"" | hi,
thx for Answer
i would use OLEDB ... if i get a "Driver" for it
but it "seems" it is not "free" for PostgreSQL any more
---
my "DualGRID" is not a "normal" App ... it should be like a "Swiss Knife" where you got a lot of Tools
it is not for User to "work" ... it is for Admin to get "quick Overview" and later "repair"
i want to learn how it work with Fivewin 64 Bit what i have made with Xbase++ and 32 Bit
---
it is a general Question how to handle BIG "Result" of SQL Query where NOT "LIMIT" is used
to "open" BIG Table (> 2.000.000) without "LIMIT" it can take Minutes even in PgAdmin
next is to "browse" and "navigate" ...
when using ADODB i got Method to "navigate" but how with ODBC <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
for my "native" Solution i use Listview and a "Cursor" which is "LIMITed" to Size of "Browse"
so i use a lot of Ways but always try to find "other" Way which is "faster" |
use Result of SQL Query like ""ADODB.Recordset"" | [quote:11chfi8z]
i would use OLEDB ... if i get a "Driver" for it
but it "seems" it is not "free" for PostgreSQL any more
[/quote:11chfi8z]
Microsoft introduced ADO as an advancement over ODBC.
ADO is designed work both with ODBC drivers and OLEDB providers.
We need not have OLEDB provider to use ADO. We can use ADO with ODBC drivers also in a way better than using ODBC directly.
We need to prepare the connection string suitably.
For OLEDB providers, we start with "Provider=<OLEDB provider>;..."
For ODBC drivers, we start with "Provider=MSDASQL;{Driver=<ODBC driver>};..."
For instance, we always connect to MySql servers with ODBC drivers only with the above syntax:
Still if you want to use ODBC directly and not through ADO, FWH provides enough classes and they did work for me with Oracle longtime ago.
Note: I never tried 64 bit ODBC driver |
use fw_arraytodbf with conditions | I have an array previously built from a txt file, in this array as the first field there is a date field, I have to convert this array into a dbf file all records if the date field (dUltimaData) is greater than the last passed date
oTemp:= TDatabase():Open( , cPath+"LOTTO", "DBFCDX", .T. )
oTemp:gobottom()
dUltimaData:=oTemp:data
olotto2:= TDatabase():Open( , cPath+"STORICO", "DBFCDX", .T. )
SET DELETED ON
olotto2:setorder(0)
oLotto2:gotop()
//FW_ArrayToDBF( aData, cFieldList, bProgress, lOverWrite, lRecallDeleted, bTrigger )
oLotto2:fw_ArrayToDBF( aData,,bProgress) // [b:fphzkak5] how insert conditions ? [/b:fphzkak5]
I need to create it because when I update the archive the old procedure deletes all the archive and re-insert all the records while it should only add the new records which then if the extraction is not updated is only one the records are only 11 and therefore the end user does not have to wait a long time to update the archive
I tried to create a new array with only the records need to me
oTemp:= TDatabase():Open( , cPath+"LOTTO", "DBFCDX", .T. )
oTemp:gobottom()
dUltimaData:=oTemp:data
For n= 1 to len(aData)
If ctod(aData[1][n]) > dUltimaData
AaDd(aNewData,{aData[1][n],;
aData[2][n],;
aData[3][n],;
aData[4][n],;
aData[5][n],;
aData[6][n],;
aData[7][n]})
Endif
Next
but make me error
[code=fw:fphzkak5]<div class="fw" id="{CB}" style="font-family: monospace;">Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">17</span><span style="color: #000000;">-09</span><span style="color: #000000;">-2022</span>, <span style="color: #000000;">12</span>:<span style="color: #000000;">56</span>:<span style="color: #000000;">24</span><br /> Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1132</span> Bound error: <span style="color: #000000;">array</span> access<br /> Args:<br /> <span style="color: #000000;">[</span> <span style="color: #000000;">1</span><span style="color: #000000;">]</span> = A <span style="color: #000000;">{</span><span style="color: #ff0000;">"07/01/1939"</span>,<span style="color: #ff0000;">"BA"</span>,<span style="color: #ff0000;">"58"</span>,<span style="color: #ff0000;">"22"</span>,<span style="color: #ff0000;">"47"</span>,<span style="color: #ff0000;">"49"</span>,<span style="color: #ff0000;">"69"</span><span style="color: #000000;">}</span> length: <span style="color: #000000;">7</span><br /> <span style="color: #000000;">[</span> <span style="color: #000000;">2</span><span style="color: #000000;">]</span> = N <span style="color: #000000;">8</span><br /><br /> </div>[/code:fphzkak5]
wich is 8 ? |
use fw_arraytodbf with conditions | [code=fw:3jyvca4c]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">For</span> n= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">(</span>aData<span style="color: #000000;">)</span><br /><span style="color: #00C800;">If</span> ctod<span style="color: #000000;">(</span>aData<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span><span style="color: #000000;">)</span> > dUltimaData<br />AaDd<span style="color: #000000;">(</span>aNewData,<span style="color: #000000;">{</span>aData<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span>,;<br />aData<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span>,;<br />aData<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span>,;<br />aData<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span>,;<br />aData<span style="color: #000000;">[</span><span style="color: #000000;">5</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span>,;<br />aData<span style="color: #000000;">[</span><span style="color: #000000;">6</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span>,;<br />aData<span style="color: #000000;">[</span><span style="color: #000000;">7</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Endif</span><br /><span style="color: #00C800;">Next</span><br /> </div>[/code:3jyvca4c]
It should be aData[ n, nCol ] or aData[ n ][ nCol ] but not aData[ nCol ][ n ]
When in the for loop "n" exceeds 7, you get this error. |
use fw_arraytodbf with conditions | [b:x2argbfl]Inserting new records:[/b:x2argbfl]
For testing, I have used a small portion of the "storico.txt"
We already have some data in STORICO.DBF and now we will try to insert new records.
[url=https://imageshack.com/i/poVDGZAzp:x2argbfl][img:x2argbfl]https://imagizer.imageshack.com/v2/xq90/924/VDGZAz.png[/img:x2argbfl][/url:x2argbfl]
[code=fw:x2argbfl]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cText, aData, aNew, dMaxDate<br /><br /> cText := HB_MEMOREAD<span style="color: #000000;">(</span> <span style="color: #ff0000;">"storico.txt"</span> <span style="color: #000000;">)</span><br /> cText := FW_ALLTRIM<span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span><br /> cText := StrTran<span style="color: #000000;">(</span> cText, CRLF, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">10</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> aData := HB_ATokens<span style="color: #000000;">(</span> cText, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">10</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// for purpose of testing we take a small portion of the Data</span><br /> ASIZE<span style="color: #000000;">(</span> aData, <span style="color: #000000;">24</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//</span><br /><br /> AEval<span style="color: #000000;">(</span> aData, <span style="color: #000000;">{</span> |c,i| aData<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> := HB_ATokens<span style="color: #000000;">(</span> c, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">9</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> AEval<span style="color: #000000;">(</span> aData, <span style="color: #000000;">{</span> |a,i| a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> := uCharToVal<span style="color: #000000;">(</span> a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, <span style="color: #ff0000;">"D"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> USE STORICO <span style="color: #00C800;">NEW</span> VIA <span style="color: #ff0000;">"DBFCDX"</span> EXCLUSIVE<br /> XBROWSER <span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> SHOW RECID<br /><br /> DBGOBOTTOM<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> dMaxDate := FIELD->DATA<br /><br /> aNew := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> AEval<span style="color: #000000;">(</span> aData, <span style="color: #000000;">{</span> |a| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> > dMaxDate, AAdd<span style="color: #000000;">(</span> aNew, a <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> FW_ArrayToDbf<span style="color: #000000;">(</span> anew <span style="color: #000000;">)</span><br /><br /> XBROWSER <span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> SHOW RECID<br /> CLOSE <span style="color: #00C800;">DATA</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:x2argbfl]
[url=https://imageshack.com/i/pnF16e9Np:x2argbfl][img:x2argbfl]https://imagizer.imageshack.com/v2/xq90/923/F16e9N.png[/img:x2argbfl][/url:x2argbfl] |
use fw_arraytodbf with conditions | [size=150:3866zwif][b:3866zwif]THANKS RAO[/b:3866zwif][/size:3866zwif] |
use fw_arraytodbf with conditions | Rao,
on my test I have the dMaxDate "10/09/2022"
and on storico.txt I arrive until 2022/09/17
when I execute
aNew := {}
AEval( aData, { |a| If( a[ 1 ] > dMaxDate, AAdd( aNew, a ), ) } )
oStorico:FW_ArrayToDbf( anew )
XBROWSER oStorico SHOW RECID
I not see any records
why ? |
use fw_arraytodbf with conditions | [quote="nageswaragunupudi":24c42mgj][b:24c42mgj]Inserting new records:[/b:24c42mgj]
For testing, I have used a small portion of the "storico.txt"
We already have some data in STORICO.DBF and now we will try to insert new records.
[url=https://imageshack.com/i/poVDGZAzp:24c42mgj][img:24c42mgj]https://imagizer.imageshack.com/v2/xq90/924/VDGZAz.png[/img:24c42mgj][/url:24c42mgj]
[code=fw:24c42mgj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cText, aData, aNew, dMaxDate<br /><br /> cText := HB_MEMOREAD<span style="color: #000000;">(</span> <span style="color: #ff0000;">"storico.txt"</span> <span style="color: #000000;">)</span><br /> cText := FW_ALLTRIM<span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span><br /> cText := StrTran<span style="color: #000000;">(</span> cText, CRLF, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">10</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> aData := HB_ATokens<span style="color: #000000;">(</span> cText, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">10</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// for purpose of testing we take a small portion of the Data</span><br /> ASIZE<span style="color: #000000;">(</span> aData, <span style="color: #000000;">24</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//</span><br /><br /> AEval<span style="color: #000000;">(</span> aData, <span style="color: #000000;">{</span> |c,i| aData<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> := HB_ATokens<span style="color: #000000;">(</span> c, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">9</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> AEval<span style="color: #000000;">(</span> aData, <span style="color: #000000;">{</span> |a,i| a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> := uCharToVal<span style="color: #000000;">(</span> a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, <span style="color: #ff0000;">"D"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> USE STORICO <span style="color: #00C800;">NEW</span> VIA <span style="color: #ff0000;">"DBFCDX"</span> EXCLUSIVE<br /> XBROWSER <span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> SHOW RECID<br /><br /> DBGOBOTTOM<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> dMaxDate := FIELD->DATA<br /><br /> aNew := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> AEval<span style="color: #000000;">(</span> aData, <span style="color: #000000;">{</span> |a| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> > dMaxDate, AAdd<span style="color: #000000;">(</span> aNew, a <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> FW_ArrayToDbf<span style="color: #000000;">(</span> anew <span style="color: #000000;">)</span><br /><br /> XBROWSER <span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> SHOW RECID<br /> CLOSE <span style="color: #00C800;">DATA</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:24c42mgj]
[url=https://imageshack.com/i/pnF16e9Np:24c42mgj][img:24c42mgj]https://imagizer.imageshack.com/v2/xq90/923/F16e9N.png[/img:24c42mgj][/url:24c42mgj][/quote:24c42mgj]
Rao I have problem
give me a xbrowse empty
Please try this test
[code=fw:24c42mgj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// PUBLIC oApp</span><br /><br /> <span style="color: #B900B9;">// HB_LangSelect("IT")</span><br /> * HB_SetCodePage<span style="color: #000000;">(</span><span style="color: #ff0000;">"ITWIN"</span><span style="color: #000000;">)</span><br /><br /> SetHandleCount<span style="color: #000000;">(</span> <span style="color: #000000;">100</span> <span style="color: #000000;">)</span><br /><br /> SET DATE FORMAT <span style="color: #ff0000;">"dd-mm-yyyy"</span><br /> SET DELETED <span style="color: #0000ff;">ON</span><br /> SET CENTURY <span style="color: #0000ff;">ON</span><br /> SET EPOCH <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">year</span><span style="color: #000000;">(</span> date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> - <span style="color: #000000;">20</span><br /> SET MULTIPLE OFF<br /><br /><br /> <span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//-----------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> <span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cText, aData, aNew, dMaxDate, oLotto<br /> <span style="color: #00C800;">local</span> aFields := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"DATA"</span> , <span style="color: #ff0000;">"D"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"RUOTA"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"N1"</span> , <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"N2"</span> , <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"N3"</span> , <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"N4"</span> , <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"N5"</span> , <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span><span style="color: #000000;">}</span><br /><br /> cText := HB_MEMOREAD<span style="color: #000000;">(</span> <span style="color: #ff0000;">"storico.txt"</span> <span style="color: #000000;">)</span><br /> cText := FW_ALLTRIM<span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span><br /> cText := StrTran<span style="color: #000000;">(</span> cText, CRLF, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">10</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> aData := HB_ATokens<span style="color: #000000;">(</span> cText, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">10</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><br /> AEval<span style="color: #000000;">(</span> aData, <span style="color: #000000;">{</span> |c,i| aData<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> := HB_ATokens<span style="color: #000000;">(</span> c, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">9</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> AEval<span style="color: #000000;">(</span> aData, <span style="color: #000000;">{</span> |a,i| a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> := uCharToVal<span style="color: #000000;">(</span> a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, <span style="color: #ff0000;">"D"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> XBROWSER aData<br /><br /> oLotto:= TDatabase<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span> , <span style="color: #ff0000;">"LOTTO"</span>, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">)</span><br /> oLotto:<span style="color: #000000;">Gobottom</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> dMaxDate := oLotto:<span style="color: #00C800;">Data</span><br /> ?dMaxDate <span style="color: #B900B9;">//TAKE LAST RECORD DATE</span><br /><br /> <span style="color: #B900B9;">//CREATE TEMP</span><br /> DBCREATE<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TEMP.DBF"</span>, aFields, <span style="color: #ff0000;">"DBFCDX"</span>, .T., <span style="color: #ff0000;">"Storico"</span> <span style="color: #000000;">)</span><br /><br /><br /> aNew := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> AEval<span style="color: #000000;">(</span> aData, <span style="color: #000000;">{</span> |a| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> > dMaxDate, AAdd<span style="color: #000000;">(</span> aNew, a <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> FW_ArrayToDbf<span style="color: #000000;">(</span> anew <span style="color: #000000;">)</span><br /><br /><br /> GO TOP<br /> XBROWSER <span style="color: #0000ff;">ALIAS</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> SHOW RECID<br /> CLOSE <span style="color: #00C800;">DATA</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:24c42mgj] |
use hb_threadStart() in a CLASS ? | hi,
to "fill" Imagelist i want to use a Thread to call a Method of CLASS
[code=fw:3aejllsj]<div class="fw" id="{CB}" style="font-family: monospace;"> AADD<span style="color: #000000;">(</span>::<span style="color: #000000;">aThread</span>, hb_threadStart<span style="color: #000000;">(</span> HB_THREAD_INHERIT_PUBLIC, @::<span style="color: #000000;">ImageThread</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span></div>[/code:3aejllsj]
or
[code=fw:3aejllsj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">LOCAL</span> oSelf := <span style="color: #00C800;">SELF</span><br /> AADD<span style="color: #000000;">(</span>::<span style="color: #000000;">aThread</span>, hb_threadStart<span style="color: #000000;">(</span> HB_THREAD_INHERIT_PUBLIC, @oSelf:<span style="color: #000000;">ImageThread</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span></div>[/code:3aejllsj]
but that Syntax does not work <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
so i change to
[code=fw:3aejllsj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">LOCAL</span> oSelf := <span style="color: #00C800;">SELF</span><br /> AADD<span style="color: #000000;">(</span>::<span style="color: #000000;">aThread</span>, hb_threadStart<span style="color: #000000;">(</span> HB_THREAD_INHERIT_PUBLIC, @TransFunc<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oSelf <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">FUNCTION</span> TransFunc<span style="color: #000000;">(</span>oSelf<span style="color: #000000;">)</span><br />fwlog <span style="color: #ff0000;">"TransFunc Start"</span>+TIME<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oSelf<br /> oSelf:<span style="color: #000000;">ImageThread</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oSelf:<span style="color: #000000;">RefreshAll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />fwlog <span style="color: #ff0000;">"TransFunc Stop"</span>+TIME<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> .T.</div>[/code:3aejllsj]
but i do not get Log-file <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
seems as Thread was not start .... hm
what i´m doing wrong <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
use hb_threadStart() in a CLASS ? | Try
[code=fw:3c2fqjf0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">LOCAL</span> oSelf := <span style="color: #00C800;">Self</span><br /><br /> AADD<span style="color: #000000;">(</span>::<span style="color: #000000;">aThread</span>, hb_threadStart<span style="color: #000000;">(</span> HB_THREAD_INHERIT_PUBLIC, <span style="color: #000000;">{</span> || oSelf:&<span style="color: #000000;">(</span><span style="color: #ff0000;">"ImageThread"</span><span style="color: #000000;">)</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> </div>[/code:3c2fqjf0] |
use hb_threadStart() in a CLASS ? | hi,
the Problem is not the Syntax. it seems Fivewin is not use -mt default
but as i understand it need "multi-Threading" else Thread does not work
i have search in Fivewin for hb_threadStart()
there is a Sample c:\fwh\samples\testmt02.prg
when press "Test" hb_threadStart() does NOT WORK and show NO MsgWait() or new Dialog <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
it seems me that Fivewin User does not know hb_threadStart()
---
when have a lot to PRINT you can not work on "other" ... right <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
NO, you can use hb_threadStart() and PRINT in "other" Thread
---
it seems to work when call
[code=fw:5rdg1s1d]<div class="fw" id="{CB}" style="font-family: monospace;">hbmk2 XXX -mt</div>[/code:5rdg1s1d]
but how when use *.MAK (BCC) or *.HBP (MSVC) <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
useful for troubleshooting system errors | <!-- m --><a class="postlink" href="http://www.dependencywalker.com/">http://www.dependencywalker.com/</a><!-- m -->
Dependency Walker is a free utility that scans any 32-bit or 64-bit Windows module (exe, dll, ocx, sys, etc.) and builds a hierarchical tree diagram of all dependent modules. For each module found, it lists all the functions that are exported by that module, and which of those functions are actually being called by other modules. Another view displays the minimum set of required files, along with detailed information about each file including a full path to the file, base address, version numbers, machine type, debug information, and more. |
useful for troubleshooting system errors | Otto,
I use PEInfo for a long time, it is very easy and usefull <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[url:rx2q4gb3]https://code.google.com/p/fivewin-contributions/downloads/detail?name=peinfo.exe[/url:rx2q4gb3] |
user name taken | I tried to submit a message under the name "don lowenstein" but system told me "username already taken" so I changed to "Don L"
Why can't I post under "don lowenstein?" |
user name taken | I wasn't "logging in" to my profile.
Please bear with me as I am "changing gears." |
user to see execution running | What msg function should be used to run showing variable counter for the user like the recno()/reccount() while do while !eof().
Ex:.
please wait..........processing record 35/2232. |
user to see execution running | Hi,
I use MSGRUN()
You can see how to use this at SAMPLES\TESTMSG.PRG
Regards, |
user to see execution running | I suggest doing it in the message bar. |
user to see execution running | how can I put the code clock inside msgrun the run :
? recno()/reccnount()
or Even How can I use it with the message bar ? |
user to see execution running | cReccount:= reccount()
DO WHILE ! eof()
wndMain():oMsgBar:setMsg( "Processing record "+ trim(str(recno()))+"/"+cReccount ) |
user to see execution running | Hola,
you can use
DEFINE DIALOG oDlg .....
ACTIVATE DIALOG oDlg.. NOWAIT
process ...... n/m
oDlg:end() |
user-defined form over OLE in Outlook | Hallo Fivewinners,
did someone use yet you user-defined forms in eMail-delivery in Outlook ?
How can I purport such a user-defined form over OLE in Outlook?
Best regards
Norbert |
user-defined form over OLE in Outlook | I do not understand |
user-defined form over OLE in Outlook | [quote="eduardofreni":29oifmnu]I do not understand[/quote:29oifmnu]
in outlook you can create user-define Formulars via "Extra"-> Formular -> Create new Formular.
You can example Create an Input-Formular for email-send. so you can in this form create checkboxe, combobox usw....
You can save the new formular with an name, example "email-Send-1" in outlook.
over Extra->Formular->Open Formular you can open this formular an send an email via this form.
now i will send from fivewin via OLE an email and select with an ole-command this form.
understand ? sorry about my bay english
best regards, Norbert |
user-defined form over OLE in Outlook | I do know for execute formular in outlook.
Eduardo Freni |
using PUBLIC FONT in DIALOG | hi,
i got this in *.LOG
[quote:14di9158]14.05.2023 21:03:46: MAIN( 624 ) "Start" = "Start"
14.05.2023 21:04:29: EXCESS RELEASE OF FONT TAHOMA[ hFont : 0] ( nCount : 0 )
<-TFONT:END(303) <-TCONTROL:DESTROY(2318) <-TBTNBMP:DESTROY(1111) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1857) <-TBTNBMP:HANDLEEVENT(2135) <-_FWH(3681) <-WINRUN(0) <-TWINDOW:ACTIVATE(1114)
------------------------------------------------------------
14.05.2023 21:04:29: EXCESS RELEASE OF FONT TAHOMA[ hFont : 0] ( nCount : -1 )
<-TFONT:END(303) <-TCONTROL:DESTROY(2318) <-TBTNBMP:DESTROY(1111) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1857) <-TBTNBMP:HANDLEEVENT(2135) <-_FWH(3681) <-WINRUN(0) <-TWINDOW:ACTIVATE(1114)
------------------------------------------------------------
14.05.2023 21:04:29: MAIN( 953 ) "Ende" = "Ende" [/quote:14di9158]
i have open DIALOG where i use a PUBLIC FONT in XBROWSE
when remove FONT or use a "local" FONT than i have no Problem ... hm
what is the Problem with PUBLIC FONT in DIALOG <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
p.s. App will still run but i want get rid of those Error.LOG |
using PUBLIC FONT in DIALOG | After ACTIVATE DIALOG
[code=fw:29ztso21]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">Do</span> <span style="color: #00C800;">While</span> oFont:<span style="color: #000000;">nCount</span> > <span style="color: #000000;">0</span><br /> oFont:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Enddo</span><br /> </div>[/code:29ztso21] |
using PUBLIC FONT in DIALOG | [quote="Jimmy":3hjs5wio]hi,
i got this in *.LOG
[quote:3hjs5wio]14.05.2023 21:03:46: MAIN( 624 ) "Start" = "Start"
14.05.2023 21:04:29: EXCESS RELEASE OF FONT TAHOMA[ hFont : 0] ( nCount : 0 )
<-TFONT:END(303) <-TCONTROL:DESTROY(2318) <-TBTNBMP:DESTROY(1111) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1857) <-TBTNBMP:HANDLEEVENT(2135) <-_FWH(3681) <-WINRUN(0) <-TWINDOW:ACTIVATE(1114)
------------------------------------------------------------
14.05.2023 21:04:29: EXCESS RELEASE OF FONT TAHOMA[ hFont : 0] ( nCount : -1 )
<-TFONT:END(303) <-TCONTROL:DESTROY(2318) <-TBTNBMP:DESTROY(1111) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1857) <-TBTNBMP:HANDLEEVENT(2135) <-_FWH(3681) <-WINRUN(0) <-TWINDOW:ACTIVATE(1114)
------------------------------------------------------------
14.05.2023 21:04:29: MAIN( 953 ) "Ende" = "Ende" [/quote:3hjs5wio]
i have open DIALOG where i use a PUBLIC FONT in XBROWSE
when remove FONT or use a "local" FONT than i have no Problem ... hm
what is the Problem with PUBLIC FONT in DIALOG <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
p.s. App will still run but i want get rid of those Error.LOG[/quote:3hjs5wio]
Impossible, unless there is a deviation in the program code from the recommended usage or creation and release of fonts.
It does not matter whether the font is Public, Private, Local or Static variable
In a well written program, there should never be a need for workarounds like:
[code=fw:3hjs5wio]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Do</span> <span style="color: #00C800;">While</span> oFont:<span style="color: #000000;">nCount</span> > <span style="color: #000000;">0</span><br /> oFont:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Enddo</span></div>[/code:3hjs5wio]
Can anyone please provide a small sample to reproduce this problem?
I tested in several ways and never got this problem.
This is one of my tests:
[code=fw:3hjs5wio]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />MEMVAR oFontP<br /><br /><span style="color: #00C800;">function</span> MaIN<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oBar<br /><br /> <span style="color: #00C800;">PUBLIC</span> oFontP<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontP <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"VERDANA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /> oWnd:<span style="color: #000000;">SetFont</span><span style="color: #000000;">(</span> oFontP <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oWnd<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">ACTION</span> ShowDlg<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFontP<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ShowDlg<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg, oBrw<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFontP<br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> DATASOURCE <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span> <span style="color: #000000;">}</span> <span style="color: #0000ff;">AUTOCOLS</span> ;<br /> <span style="color: #0000ff;">FONT</span> oFontP ;<br /> CELL LINES NOBORDER<br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:3hjs5wio] |
using PUBLIC FONT in DIALOG | hi,
i have figure out that "Problem" was in MENU which called DIALOG <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
for MENUITEM i want a FONT so i use
[code=fw:3kxwbfqp]<div class="fw" id="{CB}" style="font-family: monospace;"> oMenu:<span style="color: #000000;">oFont</span> := oFontDefault</div>[/code:3kxwbfqp]
but when close PopUp-Menu it will destroy FONT assign to oMenu:oFont
so i need to define a own FONT for MENUITEM
[code=fw:3kxwbfqp]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontMenu <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Lucida Console"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, - SP_nFontSize<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">FONT</span> oFontMenu<br /> END <span style="color: #0000ff;">FONT</span><br /> oMenu:<span style="color: #000000;">oFont</span> := oFontMenu</div>[/code:3kxwbfqp]
now it work without Error <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
sorry for my Mistake |
using CALLDLL | how may using function DanezGUS form GUS.dll
nip:-"5230000001"
text= DanezGUS(nip)
function DanezGus is in GUS.dll
and has one parameter nip and return string |
using CALLDLL | [quote="kajot":1nn8yvyp]how may using function DanezGUS form GUS.dll
nip:-"5230000001"
text= DanezGUS(nip)
function DanezGus is in GUS.dll
and has one parameter nip and return string[/quote:1nn8yvyp]
A DLL function can't return a string. Please check the DLL docs. It should have the returned string as a parameter passed by reference.
EMG |
using CALLDLL | Thanks, any samples |
using CALLDLL | This is a sample for REGQUERYVALUE:
[code=fw:ulp4ta9o]<div class="fw" id="{CB}" style="font-family: monospace;">DLL32 <span style="color: #00C800;">FUNCTION</span> REGQUERYVALUE<span style="color: #000000;">(</span> hKey AS LONG, cValueName AS LPSTR, nReserved AS LONG, @nType AS PTR, @cData AS LPSTR, @nSize AS PTR <span style="color: #000000;">)</span> AS LONG;<br /> PASCAL <span style="color: #0000ff;">FROM</span> <span style="color: #ff0000;">"RegQueryValueExA"</span> LIB <span style="color: #ff0000;">"advapi32.dll"</span></div>[/code:ulp4ta9o]
Please note
[code=fw:ulp4ta9o]<div class="fw" id="{CB}" style="font-family: monospace;">@cData AS LPSTR</div>[/code:ulp4ta9o]
EMG |
using Cmd-C and Cmd-V in get | Hello,
How can I use Cmd-C and Cmd-V in a oget. I can rightclick on a get and select copy/past, but I would like to use the keys for this. |
using Cmd-C and Cmd-V in get | René,
First select the text to copy with the mouse, then press Cmd+C to copy.
To paste, press Cmd+V |
using Cmd-C and Cmd-V in get | Hello Antonio,
At my system this does not seem to work. Check with the registration app I posted last week. I only get a beep when i select the value of the get. |
using Cmd-C and Cmd-V in get | René,
You are right. I did not tested it as I was in Windows
I am going to review it
thanks |
using Cmd-C and Cmd-V in get | Hello Antonio,
Thanks!
Is there alo a possibilty to use other hotkey functions, like Cmd-P for a printing function. |
using Cmd-C and Cmd-V in get | René,
Hotkeys must be defined in the menu.
Please add this code to your menu:
[code=fw:76jvelgh]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Edit"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copy"</span> ACCELERATOR <span style="color: #ff0000;">"c"</span> <span style="color: #0000ff;">ACTION</span> AEval<span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">aControls</span>, <span style="color: #000000;">{</span> | oCtrl | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oCtrl:<span style="color: #000000;">lFocused</span>, oCtrl:<span style="color: #000000;">Copy</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Paste"</span> ACCELERATOR <span style="color: #ff0000;">"v"</span> <span style="color: #0000ff;">ACTION</span> AEval<span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">aControls</span>, <span style="color: #000000;">{</span> | oCtrl | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oCtrl:<span style="color: #000000;">lFocused</span>, oCtrl:<span style="color: #000000;">Paste</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> </div>[/code:76jvelgh]
where oDlg is your currently used dialog. We are trying to find a way to automatically detect oDlg, so there is no need to keep
a reference to it
You could add another menuitem for Cmd+P |
using Cmd-C and Cmd-V in get | Antonio, por favor , revisa el repositorio .
Un Saludo. |
using Cmd-C and Cmd-V in get | Manuel,
Revisado y funcionando bien. Muchas gracias <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
René, Mastintin (Manuel) has solved it in a simpler way. I have emailed you the modified libs. |
using Cmd-C and Cmd-V in get | Hello Antonio and Manuel,
Thank you for this. IT works perfect. |
using Cmd-C and Cmd-V in get | very good <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
using Ctrl-Enter in Getq | Hello Antonio en Manuel,
I discovered the following problem. If I define a Get and want to start on a new line in the Get, one can use the Alt-Enter and the Ctrl-Enter. However, if one uses Ctrl-Enter the value can't be saved. The GetText is empty.
Is there a solution for this? |
using Ctrl-Enter in Getq | Esto ocurre usando Multiget o Get normal ?
if change to multiget work ? .
<!-- m --><a class="postlink" href="https://developer.apple.com/library/archive/qa/qa1454/_index.html">https://developer.apple.com/library/arc ... index.html</a><!-- m -->
In get fivemac use NsTextField .
Un Saludo. |
using FWH 2011.11 and xHarbour.com | when I compile any source using FWH 2011.11 and xharbour.com , I got error
xLINK: error: Unresolved external symbol '_HB_FUN_HB_GT_WVT referenced from (t.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_HB_GTCREATE referenced from (t.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_HB_GTSELECT referenced from (t.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_DRAWTRANSPARENT referenced from Fivehmx.lib(btnbmp.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_FWSAVEPREVIEWTOPDF referenced from Fivehmx.lib(rpreview.obj)'.
xLINK: error: Unresolved external symbol '_GlobalMemoryStatusEx referenced from Fivehcm.lib(MEM.obj)'.
xLINK: error: Unresolved external symbol '_SendInput referenced from Fivehcm.lib(KEYBRD.obj)'.
xLINK: fatal error: 7 unresolved external(s). |
using FWH 2011.11 and xHarbour.com | You have to link send32.lib:
[url:1ky8ppyc]http://code.google.com/p/harbour-and-xharbour-builds/downloads/detail?name=send32.lib&can=2&q=[/url:1ky8ppyc]
and mem32.lib:
[url:1ky8ppyc]http://code.google.com/p/harbour-and-xharbour-builds/downloads/detail?name=mem32.lib&can=2&q=[/url:1ky8ppyc] |
using FWH 2011.11 and xHarbour.com | yet I got error
Type: C >>>xlink.exe -NOEXPOBJ -MAP -FORCE:MULTIPLE -NOIMPLIB -subsystem:windows -UNMANGLE -LIBPATH:"S:\lib" -LIBPATH:"R:\lib" -LIBPATH:"R:\c_lib" -LIBPATH:"R:\c_lib\win" "t.obj" "S:\lib\send32.lib" "S:\lib\mem32.lib" "FiveHCM.lib" "FiveHMX.lib" "OptG.lib" "xhb.lib" "dbf.lib" "nsx.lib" "ntx.lib" "cdx.lib" "rmdbfcdx.lib" "ct3comm.lib" crt.lib kernel32.lib user32.lib winspool.lib ole32.lib oleaut32.lib odbc32.lib odbccp32.lib uuid.lib wsock32.lib ws2_32.lib wininet.lib advapi32.lib shlwapi.lib msimg32.lib mpr.lib OleDlg.lib version.lib comctl32.lib comdlg32.lib gdi32.lib shell32.lib winmm.lib lz32.lib Netapi32.lib -out:"t.exe"<<<
xLINK: warning: Symbol 'S:\lib\Fivehcm.lib(REGEDIT.obj)->_HB_FUN_REGOPENKEYEX previously defined at S:\lib\Fivehmx.lib(registry.obj)' is multiply defined.
xLINK: warning: Symbol 'S:\lib\Fivehcm.lib(REGEDIT.obj)->_HB_FUN_REGQUERYVALUEEX previously defined at S:\lib\Fivehmx.lib(registry.obj)' is multiply defined.
xLINK: warning: Symbol 'S:\lib\Fivehcm.lib(REGEDIT.obj)->_HB_FUN_REGSETVALUEEX previously defined at S:\lib\Fivehmx.lib(registry.obj)' is multiply defined.
xLINK: warning: Symbol 'S:\lib\Fivehcm.lib(REGEDIT.obj)->_HB_FUN_REGCLOSEKEY previously defined at S:\lib\Fivehmx.lib(registry.obj)' is multiply defined.
Creating object: t.EXP
Creating library: t.LIB
xLINK: error: Unresolved external symbol '_HB_FUN_FWSAVEPREVIEWTOPDF referenced from Fivehmx.lib(rpreview.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_DRAWTRANSPARENT referenced from Fivehmx.lib(btnbmp.obj)'.
xLINK: fatal error: 2 unresolved external(s).
Type: C >>>Couldn't build: t.exe<<<
Type: C >>>TMAKEPROJECT<<<
Type: C >>>TMAKEPROJECT:REFRESH<<<
Type: N >>> 1409<<< |
using FWH 2011.11 and xHarbour.com | We have checked it and we email you new libs, thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
using FWH 2011.11 and xHarbour.com | when I compile source (xharboure.com)
/I changed fivehcm.lib and ficehmx.lib which I received from You/
#include "FiveWin.Ch"
#include "xbrowse.ch"
//-----------------------//
Function Main()
Local aData := { ;
{ 1, 'One', 45, date(), .t. }, ;
{ 2, 'Two', 2222, date()-1, .f. } , ;
{ 3, 'Three', 3333, date()-2, .t. }, ;
{ 4, 'Four', 4444, date()-3, .f. } }
Local oDlg, oBrw, oFont
DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
DEFINE DIALOG oDlg SIZE 440,240 PIXEL FONT oFont
@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
COLUMNS 1, 2, 3, 5, 4 ;
HEADERS 'No', 'Description', 'Number', 'Status', 'Date' ;
PICTURES '99', nil, '@E 99,999.99', nil, 'dd-mmm-yyyy' ;
ARRAY aData CELL LINES NOBORDER FASTEDIT
oBrw:Status:SetCheck( , .t. )
AEval( oBrw:aCols, { |o| o:nEditType := EDIT_GET } )
oBrw:nStretchCol := STRETCHCOL_WIDEST
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
Return ( 0 )
error:
Type: C >>>xlink.exe -NOEXPOBJ -MAP -FORCE:MULTIPLE -NOIMPLIB -subsystem:windows -UNMANGLE -LIBPATH:"S:\lib" -LIBPATH:"R:\lib" -LIBPATH:"R:\c_lib" -LIBPATH:"R:\c_lib\win" "t.obj" "send32.lib" "mem32.lib" "FiveHCM.lib" "FiveHMX.lib" "OptG.lib" "xhb.lib" "dbf.lib" "nsx.lib" "ntx.lib" "cdx.lib" "rmdbfcdx.lib" "ct3comm.lib" crt.lib kernel32.lib user32.lib winspool.lib ole32.lib oleaut32.lib odbc32.lib odbccp32.lib uuid.lib wsock32.lib ws2_32.lib wininet.lib advapi32.lib shlwapi.lib msimg32.lib mpr.lib OleDlg.lib version.lib comctl32.lib comdlg32.lib gdi32.lib shell32.lib winmm.lib lz32.lib Netapi32.lib -out:"t.exe"<<<
xLINK: warning: Symbol 'S:\lib\Fivehcm.lib(REGEDIT.obj)->_HB_FUN_REGOPENKEYEX previously defined at S:\lib\Fivehmx.lib(registry.obj)' is multiply defined.
xLINK: warning: Symbol 'S:\lib\Fivehcm.lib(REGEDIT.obj)->_HB_FUN_REGQUERYVALUEEX previously defined at S:\lib\Fivehmx.lib(registry.obj)' is multiply defined.
xLINK: warning: Symbol 'S:\lib\Fivehcm.lib(REGEDIT.obj)->_HB_FUN_REGSETVALUEEX previously defined at S:\lib\Fivehmx.lib(registry.obj)' is multiply defined.
xLINK: warning: Symbol 'S:\lib\Fivehcm.lib(REGEDIT.obj)->_HB_FUN_REGCLOSEKEY previously defined at S:\lib\Fivehmx.lib(registry.obj)' is multiply defined.
Creating object: t.EXP
Creating library: t.LIB
xLINK: error: Unresolved external symbol '_HB_FUN_WHEELSCROLL referenced from Fivehmx.lib(xbrowse.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_CVALTOSTR referenced from Fivehmx.lib(xbrowse.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_NUMPICT referenced from Fivehmx.lib(xbrowse.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_FW_VALTOEXP referenced from Fivehmx.lib(xbrowse.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_UCHARTOVAL referenced from Fivehmx.lib(xbrowse.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_FWNUMFORMAT referenced from Fivehmx.lib(xbrowse.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_ISBINARYDATA referenced from Fivehmx.lib(xbrowse.obj)'.
xLINK: fatal error: 7 unresolved external(s).
Type: C >>>Couldn't build: t.exe<<<
Type: C >>>TMAKEPROJECT<<<
Type: C >>>TMAKEPROJECT:REFRESH<<<
Type: N >>> 1409<<< |
using FWH 2011.11 and xHarbour.com | Kajot,
For some reason it seems as the file valtostr.prg was not inlcuded in the library. We are resending you the libs, thanks! |
using FiveWeb from DreamHost | Please remember to create this .htaccess file at your cgi-bin folder:
[code=fw:2fwkubh7]<div class="fw" id="{CB}" style="font-family: monospace;"><Files *><br /> SetHandler cgi-script<br /></Files></div>[/code:2fwkubh7] |
using Function twice with Object as Parameter ? | hi,
i do want to use Thread which are call a Function.
i use Thread to "fill" Imagelist of Object and all in Function use Object ... except FOR ii
Question : will ii be "manipulate" by 2nd Thread when called twice <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
using Function twice with Object as Parameter ? | Jimmy,
I'm not sure I understand what you want to do but here is an example of adding a new sale amount to a oCustomer object using a function. Note that a customer object exists until you end it.
[code=fw:bvt6peas]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> addSale<span style="color: #000000;">(</span> oCustomer, nNewSale <span style="color: #000000;">)</span><br /> oCustomer:<span style="color: #000000;">TotalSales</span> := oCustomer:<span style="color: #000000;">TotalSales</span>: + nNewSale<br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span></div>[/code:bvt6peas]
However, this type of function should be made into a Method of the oCustomer object, then you can do this:
[code=fw:bvt6peas]<div class="fw" id="{CB}" style="font-family: monospace;">oCustomer:<span style="color: #000000;">AddSale</span><span style="color: #000000;">(</span> nSale <span style="color: #000000;">)</span><br /><br />? oCustomer:<span style="color: #000000;">TotalSales</span></div>[/code:bvt6peas]
James |
using Function twice with Object as Parameter ? | hi James,
thx for Answer
to use a Function twice (or more) is not Problem ... IF Function is "short" and "quick"
but i have to do a lot in Function and have a Variable "ii" in a FOR / NEXT
[code=fw:zo8kyihq]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">FOR</span> ii := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> nMax<br /> cFilename := TRIM<span style="color: #000000;">(</span> ::<span style="color: #000000;">aSource</span><span style="color: #000000;">[</span> ii <span style="color: #000000;">]</span> <span style="color: #000000;">[</span> F_NAME <span style="color: #000000;">]</span> <span style="color: #000000;">)</span></div>[/code:zo8kyihq]
as i have 2 x TGrid() which each start a Thread so both "may" use Function at "same Time"
but what if Thread 1 is at ii = 99 and 2nd Thread start at ii = 1 <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
---
my "Problem" was while i use a CLASS and can not call a Method using hb_threadStart()
[code=fw:zo8kyihq]<div class="fw" id="{CB}" style="font-family: monospace;"> hb_threadStart<span style="color: #000000;">(</span>@::<span style="color: #000000;">MyMethod</span><span style="color: #000000;">)</span><br /> hb_threadStart<span style="color: #000000;">(</span>@oSelf:<span style="color: #000000;">MyMethod</span><span style="color: #000000;">)</span><br /> hb_threadStart<span style="color: #000000;">(</span>@&MyMethod<span style="color: #000000;">)</span></div>[/code:zo8kyihq]
all of them fail ...
so i use a Function which work but i´m not sure if it is "safe" this Way
now i found a Solution to use a Method "in" CLASS when using hb_threadStart()
[code=fw:zo8kyihq]<div class="fw" id="{CB}" style="font-family: monospace;"> bMethod := <span style="color: #000000;">{</span> || ::<span style="color: #000000;">ImageThread</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">hThread</span> := hb_threadStart<span style="color: #000000;">(</span> HB_BITOR<span style="color: #000000;">(</span> HB_THREAD_INHERIT_PUBLIC, HB_THREAD_MEMVARS_COPY <span style="color: #000000;">)</span>, @bMethod <span style="color: #000000;">)</span></div>[/code:zo8kyihq]
i "think" that this is "safe" as each Object have its own Instance so Variable are not "visible Outside" |
using Resedit instead of Pelles | On Xmate I have
[code=fw:3lp1i311]<div class="fw" id="{CB}" style="font-family: monospace;">C_RC_COMMAND=c:\work\PellesC\Bin\PORC.EXE %RC% /I c:\work\pellesc\include /I c:\work\pellesc\include\win</div>[/code:3lp1i311]
If I wanted to use resedit instead of Pellesc how should I put in this command line? |
using Resedit instead of Pelles | Hi Silvio !
IMHO you can`t do it with ResEdit. Try with Resource Hacker [url:s5r6cojx]http://www.angusj.com/resourcehacker/[/url:s5r6cojx]
Good luck !
Best regards, |
using a Python module from Harbour according to IA | generated using [url:iu8g0kdm]https://beta.openai.com/playground[/url:iu8g0kdm]
[code=fw:iu8g0kdm]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapi.h"</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> MAIN <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> Py_Initialize<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /><br /> PyObject* pName;<br /> pName = PyString_FromString<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> char * <span style="color: #000000;">)</span> <span style="color: #ff0000;">"my_module"</span> <span style="color: #000000;">)</span>;<br /><br /> PyObject* pModule;<br /> pModule = PyImport_Import<span style="color: #000000;">(</span> pName <span style="color: #000000;">)</span>;<br /><br /> PyObject* pDict;<br /> pDict = PyModule_GetDict<span style="color: #000000;">(</span> pModule <span style="color: #000000;">)</span>;<br /><br /> PyObject* pFunc;<br /> pFunc = PyDict_GetItemString<span style="color: #000000;">(</span> pDict, <span style="color: #000000;">(</span> char * <span style="color: #000000;">)</span> <span style="color: #ff0000;">"my_function"</span> <span style="color: #000000;">)</span>;<br /><br /> PyObject* pArgs;<br /> pArgs = PyTuple_New<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> PyObject* pValue;<br /> pValue = PyInt_FromLong<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> PyTuple_SetItem<span style="color: #000000;">(</span> pArgs, <span style="color: #000000;">0</span>, pValue <span style="color: #000000;">)</span>;<br /><br /> PyObject_CallObject<span style="color: #000000;">(</span> pFunc, pArgs <span style="color: #000000;">)</span>;<br /><br /> Py_DECREF<span style="color: #000000;">(</span> pName <span style="color: #000000;">)</span>;<br /> Py_DECREF<span style="color: #000000;">(</span> pArgs <span style="color: #000000;">)</span>;<br /> Py_DECREF<span style="color: #000000;">(</span> pModule <span style="color: #000000;">)</span>;<br /><br /> Py_Finalize<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /><br /> hb_retl<span style="color: #000000;">(</span> HB_TRUE <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span></div>[/code:iu8g0kdm] |
using a Python module from Harbour according to IA | Using Python from Harbour, working <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[url:29ny91al]https://github.com/FiveTechSoft/harbour_python[/url:29ny91al] |
using a Python module from Harbour according to IA | Wow!
Good news, today I'm using Chilkat because I need some features that Harbour don't have, for example XmlDSigGen,
using Pyton for sure there are no limitation to do this.
Thank you Antonio, best regards. |
using dotmatrix printer | how may I print in text mode on dotmatrix pinter using win32prn ?
best regards
kajot |
using dotmatrix printer | Kajot,
Below is an old message--perhaps it will help.
Regards,
James
-------------------------------------------------------------
From: "David Williams" <[email protected]>
Subject: Re: Printers and printable width using generic text driver
Date: Friday, May 07, 2004 5:56 AM
Thanks Byron,
I've been away for a few days but yes, this is what I ended up doing.
I got details from a posting on xHarbour NG dated 22/09/2003 from Peter
Rees.
Many thanks
David
"Byron Hopp" <[email protected]> wrote in message
news:[email protected]...
> We place the text in a file and then print it using WinPrintRaw()
>
> Set printer to "MyFile.Prn"
> ?"Stuff"
> ??" More Stuff"
> Set Printer To // closes the file
>
> Function SendItRaw(cFile,nPrinterType)
> Local cDocument := "From BCDS32 " + alltrim(cFile) + " in Direct Print
> (RAW) Format..."
> Local nRv := 0
> nRv := WinPrintRaw(IIF( nPrinterType ==
> DOT_MATRIX,cDotPrinter,cLaserPrinter),cFile,cDocument)
> Return nRv
>
> cDotPrinter, and cLaserPrinter are Windows Printer Names. Its not pretty,
> but it works great. In our case we are printing to a very expensive Dot
> Matrix which prints very fast. We could not get the speed using the
windows
> drivers.
>
> Byron...
>
> "David Williams" <[email protected]> wrote in message
> news:[email protected]...
> > When printing a report on fanfold paper that had 132 columns in DOS, I
can
> > only get 115 cols in Windows (Any flavour).
> >
> > The same printer is used, an OKI 3400 and I have also tried the OKI 591.
> > They all print full width in DOS.
> >
> > I use generic text only, in order to speed up the printing and I'm using
> > DEFINE FONT oFont NAME "Courier New" SIZE -0, -12
> >
> > I have tried setting different paper sizes in Windows, US STD FANFOLD,
> > GERMAN FANFOLD, LEDGER etc. No luck.
> >
> > When I manually change the printer settings from 10cpi to 12cpi or
17cpi,
> I
> > still only get 115 cols but with smaller characters.
> >
> > 90% of all my support calls come from printing on matrix printers.
> > Pre-printed forms going askew etc..
> >
> > My questions:
> >
> > Is it the generic text driver?
> > Is there another driver available? One that will not slow down the
> printing
> > by going into graphic mode.
> > Is there any website that deals with these specific problems on matrix
> > printers that I can read up on?
> >
> > I'm using xHarbour 0.92 and FWH Nov 2003.
> > Any suggestions would be much appreciated.
> >
> > TIA
> > David
> >
> >
>
> |
using regular expressions | [code=fw:1rr19hdf]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> aMatch := hb_regexAll<span style="color: #000000;">(</span> <span style="color: #ff0000;">'[a-z0-9_]+'</span>, <span style="color: #ff0000;">"function Main()"</span>,.F.<span style="color: #B900B9;">/*CASE*/</span>,<span style="color: #B900B9;">/*line*/</span>,<span style="color: #B900B9;">/*nMat*/</span>,<span style="color: #B900B9;">/*nGet*/</span>,.F.<span style="color: #B900B9;">/*onlyName*/</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> n<br /><br /> ? Len<span style="color: #000000;">(</span> aMatch <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> aMatch <span style="color: #000000;">)</span><br /> ? <span style="color: #ff0000;">"1: "</span>,aMatch<span style="color: #000000;">[</span> n,<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, <span style="color: #ff0000;">" from "</span>, aMatch<span style="color: #000000;">[</span> n,<span style="color: #000000;">1</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">]</span>,<span style="color: #ff0000;">"to "</span>,aMatch<span style="color: #000000;">[</span> n,<span style="color: #000000;">1</span>,<span style="color: #000000;">3</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1rr19hdf]
[url:1rr19hdf]https://regex101.com[/url:1rr19hdf] |
using regular expressions | <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Personally prefer [url=https://www.debuggex.com/:33h7xffg]Debuggex[/url:33h7xffg] the visual view helps you to understand what regex does. |
using regular expressions | A tokenizer using regex:
[code=fw:3ru1tfbu]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> aTokens := hb_regexAll<span style="color: #000000;">(</span> <span style="color: #ff0000;">'[a-z][a-z]*'</span>, <span style="color: #ff0000;">"this is a test"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> aToken<br /> <br /> <span style="color: #00C800;">for</span> each aToken in aTokens <br /> ? aToken<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">next</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3ru1tfbu] |
using regular expressions | tokenizer with positions
[code=fw:5on6lc1d]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> aTokens := hb_regexAll<span style="color: #000000;">(</span> <span style="color: #ff0000;">'[a-z][a-z]*'</span>, <span style="color: #ff0000;">"This is a test"</span>, .F.,,,,.F. <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> aToken<br /><br /> <span style="color: #00C800;">for</span> each aToken in aTokens <br /> ? aToken<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, <span style="color: #ff0000;">"from"</span>, aToken<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, <span style="color: #ff0000;">"to"</span>, aToken<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">next</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:5on6lc1d] |
using regular expressions | you can use "[a-z]+"[url=https://www.rexegg.com/regex-quickstart.html#quantifiers:1v9rfmn1]'+' means one or more times[/url:1v9rfmn1], in those case you can use "\w+", [url=https://www.rexegg.com/regex-quickstart.html#chars:1v9rfmn1]\w means any word character: letters, number and underscore[/url:1v9rfmn1] |
using regular expressions | Antonino,
They don't work with Harbour regex. The one that I have posted is the only one that I got properly working <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[img:2zessexs]https://github.com/FiveTechSoft/screenshots/blob/master/regex.JPG?raw=true[/img:2zessexs] |
using regular expressions | A ver si sirve ( cambiar el nombre del fichero PRG que utilizo si no existe )
[code=fw:2t5j2g5j]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">// Ejemplo de uso de Expresiones Regulares</span><br /><span style="color: #B900B9;">// Example of using Regular Expressions</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> aSamples := <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">6</span>, <span style="color: #000000;">7</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">9</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">11</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">13</span>, <span style="color: #000000;">14</span>, <span style="color: #000000;">100</span>, ;<br /> <span style="color: #000000;">101</span>, <span style="color: #000000;">102</span>, <span style="color: #000000;">103</span>, <span style="color: #000000;">104</span>, <span style="color: #000000;">105</span>, <span style="color: #000000;">106</span>, <span style="color: #000000;">107</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> nOpc<br /> <span style="color: #00C800;">local</span> x<br /><br /> <span style="color: #B900B9;">// One sample</span><br /><br /> nOpc := <span style="color: #000000;">3</span><br /> RegExSample<span style="color: #000000;">(</span> nOpc <span style="color: #000000;">)</span> <br /><br /> <span style="color: #B900B9;">// All samples</span><br /> <span style="color: #00C800;">For</span> x = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> aSamples <span style="color: #000000;">)</span><br /> nOpc := aSamples<span style="color: #000000;">[</span> x <span style="color: #000000;">]</span><br /> RegExSample<span style="color: #000000;">(</span> nOpc <span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">Next</span> x<br /><br /><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">Function</span> RegExSample<span style="color: #000000;">(</span> nOpc <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> cRegEx := <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">Local</span> aMatch<br /> <span style="color: #00C800;">Local</span> oItem<br /> <span style="color: #00C800;">Local</span> aItems := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">Local</span> cString := <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">Local</span> cWords := <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">Local</span> cWords1 := <span style="color: #ff0000;">""</span><br /><br /> <span style="color: #00C800;">Local</span> cFile := <span style="color: #ff0000;">"..<span style="color: #000000;">\s</span>ource<span style="color: #000000;">\c</span>lasses<span style="color: #000000;">\T</span>Fivedit.prg"</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> nOpc := <span style="color: #000000;">0</span><br /> <br /> cString := <span style="color: #ff0000;">"En un lugar De la Mancha"</span> + CRLF<br /> cString += <span style="color: #ff0000;">"de cuyo nombre no"</span> + CRLF<br /> cString += <span style="color: #ff0000;">"quiero acordarme de"</span> + CRLF<br /> cString += <span style="color: #ff0000;">" de eso no quiero acordarme de"</span> + CRLF<br /> cString += <span style="color: #ff0000;">"nada de nada así que descansa mucho"</span> + CRLF<br /> cString += <span style="color: #ff0000;">" Local oObj1 := New():MyClass( n, m )"</span> + CRLF<br /> cString += <span style="color: #ff0000;">" Local oObj2 := New( ):MyClass( n, m )"</span> + CRLF<br /> cString += <span style="color: #ff0000;">"cVar = (parametros)"</span> + CRLF<br /> cString += <span style="color: #ff0000;">"cVar = ( parameters)"</span> + CRLF<br /> cString += <span style="color: #ff0000;">"cVar = (parameters )"</span> + CRLF<br /> cString += <span style="color: #ff0000;">"cVar = (parameters )"</span> + CRLF<br /> cString += <span style="color: #ff0000;">"cVar = ( parameters1 )"</span> + CRLF<br /> cString += <span style="color: #ff0000;">"cVar = 8"</span> + CRLF<br /> cString += <span style="color: #ff0000;">"cVar := 4"</span> + CRLF<br /><br /> <span style="color: #B900B9;">//</span><br /> <br /> cWords1 := <span style="color: #ff0000;">"(activex|"</span> + ;<br /> <span style="color: #ff0000;">"bitmap|brush|btnbmp|button|buttonbmp|buttonbar|"</span> + ;<br /> <span style="color: #ff0000;">"checkbox|calex|clipboard|combobox|combometro|cursor|"</span> + ;<br /> <span style="color: #ff0000;">"dbcombo|dialog|dtpicker|"</span> + ;<br /> <span style="color: #ff0000;">"edit|explorerbar|"</span> + ;<br /> <span style="color: #ff0000;">"flatbtn|folder|folderex|font|"</span> + ;<br /> <span style="color: #ff0000;">"get|graph|group|"</span> + ;<br /> <span style="color: #ff0000;">"icon|image|imagelist|imgbitmap|"</span> + ;<br /> <span style="color: #ff0000;">"layout|listbox|listview|"</span> + ;<br /> <span style="color: #ff0000;">"mail|metafile|meter|meterex|msgbar|msgitem|"</span> + ;<br /> <span style="color: #ff0000;">"outlook|"</span> + ;<br /> <span style="color: #ff0000;">"panel|pen|progress|"</span> + ;<br /> <span style="color: #ff0000;">"radio|radioitem|rebar|ribbonbar|richedit|richedit5|"</span> + ;<br /> <span style="color: #ff0000;">"say|saybarcode|scrollbar|scrollmsg|scrollmetro|selector|slider|"</span> + ;<br /> <span style="color: #ff0000;">"splitter|statusbar|switch|"</span> + ;<br /> <span style="color: #ff0000;">"tabcontrol|tbbutton|tbmenu|tbseparator|timer|"</span> + ;<br /> <span style="color: #ff0000;">"tmpicker|toolbar|trackbar|treeview|"</span> + ;<br /> <span style="color: #ff0000;">"windows|"</span> + ;<br /> <span style="color: #ff0000;">"ximage|xbrowse)"</span><br /><br /> <span style="color: #00C800;">Do</span> <span style="color: #00C800;">Case</span><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">1</span><br /> <span style="color: #B900B9;">// Buscar una linea que empiece por...</span><br /> cWords := <span style="color: #ff0000;">"de"</span><br /> cRegEx := <span style="color: #ff0000;">'^'</span> + cWords<br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">2</span><br /> <span style="color: #B900B9;">// Buscar una linea que empiece por... ( con espacios o no delante )</span><br /> cWords := <span style="color: #ff0000;">"de"</span><br /> cRegEx := <span style="color: #ff0000;">'^<span style="color: #000000;">\s</span>*'</span> + cWords<br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">3</span><br /> <span style="color: #B900B9;">// Buscar una Palabra que empiece por...</span><br /> cString := MemoRead<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cWords := <span style="color: #ff0000;">"new"</span><br /> cRegEx := <span style="color: #ff0000;">'<span style="color: #000000;">\b</span>'</span> + cWords<br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">4</span><br /> <span style="color: #B900B9;">// Buscar una Palabra completa</span><br /> cWords := <span style="color: #ff0000;">"de"</span><br /> cRegEx := <span style="color: #ff0000;">'<span style="color: #000000;">\b</span>'</span> + cWords + <span style="color: #ff0000;">'<span style="color: #000000;">\b</span>'</span><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">5</span><br /> <span style="color: #B900B9;">// Buscar todas las palabras</span><br /> cWords := <span style="color: #ff0000;">""</span><br /> cRegEx := <span style="color: #ff0000;">'<span style="color: #000000;">\w</span>+'</span> <span style="color: #B900B9;">// es lo mismo que: '[a-z0-9_]+'</span><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">6</span><br /> <span style="color: #B900B9;">// Buscar si exite := ó =</span><br /> cWords := <span style="color: #ff0000;">"cvar"</span><br /> cRegEx := <span style="color: #ff0000;">'<span style="color: #000000;">\b</span>'</span> + cWords + <span style="color: #ff0000;">'<span style="color: #000000;">\b</span>.{0,20}:='</span> + <span style="color: #ff0000;">"|"</span> + <span style="color: #ff0000;">'<span style="color: #000000;">\b</span>'</span> + cWords + <span style="color: #ff0000;">'<span style="color: #000000;">\b</span>.{0,20}='</span><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">7</span><br /> <span style="color: #B900B9;">// Buscar si exite ':=' ó '='</span><br /> cWords := <span style="color: #ff0000;">".*"</span><br /> cRegEx := <span style="color: #ff0000;">'<span style="color: #000000;">\b</span>'</span> + cWords + <span style="color: #ff0000;">'<span style="color: #000000;">\b</span>.{0,20}:='</span> + <span style="color: #ff0000;">"|"</span> + <span style="color: #ff0000;">'<span style="color: #000000;">\b</span>'</span> + cWords + <span style="color: #ff0000;">'<span style="color: #000000;">\b</span>.{0,20}='</span><br /><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">8</span><br /> <span style="color: #B900B9;">// Buscar una(s) Palabra(s) completa(s) entre los paréntesis</span><br /> cWords := <span style="color: #ff0000;">".*"</span><br /> cRegEx := <span style="color: #ff0000;">"<span style="color: #000000;">\(</span>"</span> + cWords + <span style="color: #ff0000;">"<span style="color: #000000;">\)</span>"</span><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">9</span><br /> <span style="color: #B900B9;">// </span><br /> cWords := <span style="color: #ff0000;">""</span><br /> cRegEx := <span style="color: #ff0000;">"New<span style="color: #000000;">\(</span>"</span> + cWords + <span style="color: #ff0000;">"<span style="color: #000000;">\)</span>"</span><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">10</span><br /> <span style="color: #B900B9;">// </span><br /> cWords := <span style="color: #ff0000;">".*"</span><br /> cRegEx := <span style="color: #ff0000;">"New<span style="color: #000000;">\(</span>"</span> + cWords + <span style="color: #ff0000;">"<span style="color: #000000;">\)</span>"</span><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">11</span><br /> <span style="color: #B900B9;">// Busca definicion de controles con @</span><br /> cString := MemoRead<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cWords := <span style="color: #ff0000;">"@"</span><br /> cRegEx := <span style="color: #ff0000;">'^<span style="color: #000000;">\s</span>*'</span> + cWords + <span style="color: #ff0000;">".*"</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>"</span> + cWords1<br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">12</span><br /> <span style="color: #B900B9;">// Busca definicion de controles con DEFINE</span><br /> cString := MemoRead<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cWords := <span style="color: #ff0000;">"define|redefine"</span><br /> cRegEx := <span style="color: #ff0000;">'^<span style="color: #000000;">\s</span>*'</span> + cWords + <span style="color: #ff0000;">".*"</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>"</span> + cWords1<br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">13</span><br /> <span style="color: #B900B9;">// Busca definicion de controles con DEFINE</span><br /> cString := MemoRead<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cWords := <span style="color: #ff0000;">"(database|editvars|fwconnect|ini|menu|menuitem|print|report)"</span><br /> cRegEx := <span style="color: #ff0000;">'^<span style="color: #000000;">\s</span>*'</span> + cWords + <span style="color: #ff0000;">".*"</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>"</span><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">14</span><br /> <span style="color: #B900B9;">// Busca definicion de controles con DEFINE</span><br /> cString := MemoRead<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cWords := <span style="color: #ff0000;">"(include|define|xtranslate|xcommand|pragma)"</span><br /> cRegEx := <span style="color: #ff0000;">'^<span style="color: #000000;">\s</span>*#'</span> + cWords + <span style="color: #ff0000;">".*"</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>"</span><br /><br /> <span style="color: #B900B9;">// Siguiente paso, leer lineas que contengan @ como primer caracter</span><br /> <span style="color: #B900B9;">// Leer lineas que tengan como primera palabra "DEFINE", ojo, que no tengan #</span><br /> <span style="color: #B900B9;">// Leer lineas que tengan como primera palabra "ACTIVATE" ¿?</span><br /> <span style="color: #B900B9;">// Todo eso para detectar qué clase estamos utilizando</span><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">100</span><br /> cString := MemoRead<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cWords := <span style="color: #ff0000;">"class"</span><br /> cRegEx := <span style="color: #ff0000;">'^<span style="color: #000000;">\s</span>*'</span> + cWords + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>"</span> + <span style="color: #ff0000;">".*"</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>"</span><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">101</span><br /> cString := MemoRead<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cWords := <span style="color: #ff0000;">"endclass"</span><br /> cRegEx := <span style="color: #ff0000;">'^<span style="color: #000000;">\s</span>*'</span> + cWords<br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">102</span><br /> cString := MemoRead<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cWords := <span style="color: #ff0000;">"classdata"</span><br /> cRegEx := <span style="color: #ff0000;">'^<span style="color: #000000;">\s</span>*'</span> + cWords + <span style="color: #ff0000;">".*"</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>"</span><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">103</span><br /> cString := MemoRead<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cWords := <span style="color: #ff0000;">"data"</span><br /> cRegEx := <span style="color: #ff0000;">'^<span style="color: #000000;">\s</span>*'</span> + cWords + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>"</span> + <span style="color: #ff0000;">".*"</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>"</span><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">104</span><br /> cString := MemoRead<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cWords := <span style="color: #ff0000;">""</span><br /> cRegEx := <span style="color: #ff0000;">'^<span style="color: #000000;">\s</span>*'</span> + <span style="color: #ff0000;">"method"</span> + <span style="color: #ff0000;">".*"</span> + <span style="color: #ff0000;">"class"</span> + <span style="color: #ff0000;">".*"</span><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">105</span><br /> cString := MemoRead<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cWords := <span style="color: #ff0000;">""</span><br /> cRegEx := <span style="color: #ff0000;">'^<span style="color: #000000;">\s</span>*'</span> + <span style="color: #ff0000;">"method"</span> + <span style="color: #ff0000;">".*"</span> + <span style="color: #ff0000;">"inline"</span> + <span style="color: #ff0000;">".*"</span><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">106</span><br /> cString := MemoRead<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cWords := <span style="color: #ff0000;">"(function|static function|func|procedure|proc|static procedure)"</span><br /> cRegEx := <span style="color: #ff0000;">'^<span style="color: #000000;">\s</span>*'</span> + cWords + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>"</span> + <span style="color: #ff0000;">".*"</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>"</span><br /><br /> <span style="color: #00C800;">Case</span> nOpc = <span style="color: #000000;">107</span><br /> cString := MemoRead<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> cWords := <span style="color: #ff0000;">"(local|private|static|public)"</span><br /> cRegEx := <span style="color: #ff0000;">'^<span style="color: #000000;">\s</span>*'</span> + cWords + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>"</span> + <span style="color: #ff0000;">".*"</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\b</span>"</span><br /><br /> <span style="color: #00C800;">EndCase</span><br /><br /> <span style="color: #B900B9;">//</span><br /> <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">(</span> nOpc <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> !Hb_IsNil<span style="color: #000000;">(</span> HB_RegExComp<span style="color: #000000;">(</span> cRegEx, .F., <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//</span><br /> aMatch := hb_regexAll<span style="color: #000000;">(</span> cRegEx, cString, .F., .T., , , .F. <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//</span><br /> <span style="color: #00C800;">For</span> Each oItem IN aMatch<br /> <span style="color: #B900B9;">//if oItem:__enumIndex == 2</span><br /> <span style="color: #B900B9;">// "Cadena" , "Posicion Inicial", "Posicion Final"</span><br /> AAdd<span style="color: #000000;">(</span> aItems, <span style="color: #000000;">{</span> oItem<span style="color: #000000;">[</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, oItem<span style="color: #000000;">[</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, oItem<span style="color: #000000;">[</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Next</span><br /> <span style="color: #0000ff;">XBrowse</span><span style="color: #000000;">(</span> aItems <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> cRegEx, <span style="color: #ff0000;">"Error"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #B900B9;">//</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /> </div>[/code:2t5j2g5j] |
using regular expressions | [img:37pna9p4]https://i.imgur.com/8A7Em95.png[/img:37pna9p4] really? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.