messages
listlengths 1
1
| topic
stringlengths 2
60
|
|---|---|
[
{
"date": "2017-05-18",
"forum": "AI Introduction (Harbour code and samples)",
"text": "OK, I found the problem!\n\nIt only occurs when I copy code from the forum. Sometimes there are special characters (invisible) instead of spaces indenting the code. I this case it was this line:\n\n[code=fw:35ao5vy2]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00C800;\">CLASS</span> TPerceptron<br /> <span style=\"color: #00C800;\">METHOD</span> <span style=\"color: #00C800;\">New</span><br /><span style=\"color: #000000;\">[</span>special characters<span style=\"color: #000000;\">]</span><span style=\"color: #00C800;\">METHOD</span> Learn<br /><span style=\"color: #00C800;\">ENDCLASS</span><br /><br /> </div>[/code:35ao5vy2]\n\nWhen I changed the invisible characters to spaces there are no more errors.\n\nI haven't figured out which characters they are as it is difficult to do with hex view in my editor. At first I thought they were tabs, but I inserted tabs and they work fine.\n\nJames",
"time": "17:39",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "James Bott"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-05-18",
"forum": "AI Introduction (Harbour code and samples)",
"text": "Ok, normally you use 3 spaces to indent. These are hex 20,20,20.\n\nSome of the lines in the Perceptron code indented with spaces but others are indented with A0,20,A0. This causes a syntax error by the compiler.\n\nI am at a loss as to how code that was working, can then be uploaded to the forum and end up with the A0,20,A0 syntax. I have never seen this until recently. Perhaps the forum software is doing this and it wasn't before?\n\nRegards,\nJames",
"time": "18:15",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "James Bott"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-05-18",
"forum": "AI Introduction (Harbour code and samples)",
"text": "James,\n\nI copied from the posted code and did a past with my editor.\nMaybe Your used EDITOR is the problem ?\n\nregards\nUwe <!-- s:?: --><img src=\"{SMILIES_PATH}/icon_question.gif\" alt=\":?:\" title=\"Question\" /><!-- s:?: -->",
"time": "21:08",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "ukoenig"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-05-18",
"forum": "AI Introduction (Harbour code and samples)",
"text": "The problem is a bug in MS Edge. Try with IE and it will work fine.\n\nEMG",
"time": "21:48",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Enrico Maria Giordano"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-05-18",
"forum": "AI Introduction (Harbour code and samples)",
"text": "Enrico,\n\n[quote:3qv9r2wi]The problem is a bug in MS Edge. Try with IE and it will work fine.[/quote:3qv9r2wi]\n\nThanks so much for that tip. I am using Edge. I'll try to remember the next time I copy text to use IE.\n\nI have been using Edge for a couple of years now and I never had that problem before. I suppose the bug must have been introduced recently.\n\nRegards,\nJames",
"time": "22:35",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "James Bott"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-05-19",
"forum": "AI Introduction (Harbour code and samples)",
"text": "Antonio,\n\nPardon me for accidentally hijacking your thread.\n\nI have found a good article about preceptrons:\n\n[url=https://appliedgo.net/perceptron/:1ckugwjd]Perceptrons - the most basic form of a neural network[/url:1ckugwjd]\n\nJames",
"time": "00:15",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "James Bott"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-05-19",
"forum": "AI Introduction (Harbour code and samples)",
"text": "I've been looking for some old source code to prove it to myself but this looks very similar to what I was taught as Predictor/Corrector methods back in the mid-80s when I was working on my mechanical engineering degree. I had forgotten about it until reading this code. If I remember correctly, for learning purposes, we used it for contour mapping, as in topographical maps. I remember it being fun to work with, but for the life of me I can't recall how it actually worked. I would need to find the original source to be sure. I may only have it on a floppy disk, probably written in Fortran 77.\n\nI did do some derivative work based on that method, written for an aerospace company, which means nothing I owned or can share as I wouldn't have a copy. I suppose the original code I wrote it in college I own. If I can find it I'll see about porting it to harbour and will share it. Don't wait for it, it may be on a 5 1/4\" floppy disk, and I don't have one of those drives anywhere any longer.\n\nRobb",
"time": "04:03",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "rhlawek"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-05-19",
"forum": "AI Introduction (Harbour code and samples)",
"text": "[quote=\"James Bott\":1oab6g2e]Enrico,\n\n[quote:1oab6g2e]The problem is a bug in MS Edge. Try with IE and it will work fine.[/quote:1oab6g2e]\n\nThanks so much for that tip. I am using Edge. I'll try to remember the next time I copy text to use IE.\n\nI have been using Edge for a couple of years now and I never had that problem before. I suppose the bug must have been introduced recently.\n\nRegards,\nJames[/quote:1oab6g2e]\n\nYes, I saw it the first time with W10 Anniversary Update, if I remember correctly.\n\nEMG",
"time": "09:03",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Enrico Maria Giordano"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-05-19",
"forum": "AI Introduction (Harbour code and samples)",
"text": "[quote=\"rhlawek\":37plpnov]I've been looking for some old source code to prove it to myself but this looks very similar to what I was taught as Predictor/Corrector methods back in the mid-80s[/quote:37plpnov]\n\nYes, it's a very old concept. But still interesting.\n\nEMG",
"time": "09:04",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Enrico Maria Giordano"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-05-19",
"forum": "AI Introduction (Harbour code and samples)",
"text": "Pedro Domingos name them \"learners\": software that can \"learn\" from data.\n\nThe simplest way of learning from data is comparing two bytes. How ? Substracting them: A zero means they are equal, different from zero means they are different.\nThe difference between them is the \"error\". To correct the error, we modify a \"weight\" . Its amazing that from that simple concept, all what can be built. In the same way all our software technology comes from a bit, being zero or one.\n\nThe perceptron mimics (in a very simple way) the behavior of a brain neuron. The neuron receives several inputs, each one has a weight (stored at the neuron) and the sum of all those inputs times their weights may fire or not an output.\n\nBackpropagation helps to fine tune those weights, and finally the perceptron \"adjusts\" itself to the right weight for each input to produce the expected output.\n\nAI is already everywhere and will change very much our lives and the way software is developed <!-- s:-) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":-)\" title=\"Smile\" /><!-- s:-) -->",
"time": "11:35",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Antonio Linares"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-05-23",
"forum": "AI Introduction (Harbour code and samples)",
"text": "[img:3eaqkasd]https://bitbucket.org/fivetech/screenshots/downloads/perceptron.JPG[/img:3eaqkasd]",
"time": "09:49",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Antonio Linares"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-05-23",
"forum": "AI Introduction (Harbour code and samples)",
"text": "[img:34qo88ic]https://bitbucket.org/fivetech/screenshots/downloads/redNeuronal.JPG[/img:34qo88ic]\n\nPerceptrón [b:34qo88ic]Multicapa[/b:34qo88ic]",
"time": "10:33",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Antonio Linares"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-05-26",
"forum": "AI Introduction (Harbour code and samples)",
"text": "C and C++ source code:\n\n<!-- l --><a class=\"postlink-local\" href=\"http://forums.fivetechsupport.com/viewtopic.php?f=6&t=33946&p=202105#p202104\">viewtopic.php?f=6&t=33946&p=202105#p202104</a><!-- l -->",
"time": "19:37",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Antonio Linares"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-05-26",
"forum": "AI Introduction (Harbour code and samples)",
"text": "David Miller C++ code ported to Harbour:\n\n<!-- l --><a class=\"postlink-local\" href=\"http://forums.fivetechsupport.com/viewtopic.php?p=202115#p202115\">viewtopic.php?p=202115#p202115</a><!-- l -->\n\nDon't miss to try your first neural network <!-- s:-) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":-)\" title=\"Smile\" /><!-- s:-) -->",
"time": "21:05",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Antonio Linares"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-06-01",
"forum": "AI Introduction (Harbour code and samples)",
"text": "Inspecting the neural network:\n\n[code=fw:2s7helmi]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</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> oNet := TNet<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;\">1</span>, <span style=\"color: #000000;\">2</span>, <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">}</span> <span style=\"color: #000000;\">)</span>, n<br /> <span style=\"color: #00C800;\">local</span> x <br /><br /> <span style=\"color: #00C800;\">while</span> oNet:<span style=\"color: #000000;\">nRecentAverageError</span> < <span style=\"color: #000000;\">0.95</span><br /> oNet:<span style=\"color: #000000;\">FeedForward</span><span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">{</span> x := nRandom<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">1000</span> <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">}</span> <span style=\"color: #000000;\">)</span><br /> oNet:<span style=\"color: #000000;\">Backprop</span><span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">{</span> <span style=\"color: #00C800;\">If</span><span style=\"color: #000000;\">(</span> x % <span style=\"color: #000000;\">5</span> == <span style=\"color: #000000;\">0</span>, <span style=\"color: #000000;\">5</span>, <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">}</span> <span style=\"color: #000000;\">)</span> <br /> end <br /><br /> oNet:<span style=\"color: #000000;\">FeedForward</span><span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">{</span> <span style=\"color: #000000;\">15</span> <span style=\"color: #000000;\">}</span> <span style=\"color: #000000;\">)</span><br /> <br /> XBROWSER ArrTranspose<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">{</span> <span style=\"color: #ff0000;\">\"Layer 1 1st neuron\"</span> + CRLF + <span style=\"color: #ff0000;\">\"Input:\"</span> + Str<span style=\"color: #000000;\">(</span> oNet:<span style=\"color: #000000;\">aLayers</span><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: #000000;\">nOutput</span> <span style=\"color: #000000;\">)</span> + ;<br /> CRLF + <span style=\"color: #ff0000;\">\"Weigth 1:\"</span> + Str<span style=\"color: #000000;\">(</span> oNet:<span style=\"color: #000000;\">aLayers</span><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: #000000;\">aWeights</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">]</span>, <span style=\"color: #000000;\">4</span>, <span style=\"color: #000000;\">2</span> <span style=\"color: #000000;\">)</span>, ;<br /> <span style=\"color: #000000;\">{</span> <span style=\"color: #ff0000;\">\"Layer 2, 1st neuron\"</span> + CRLF + <span style=\"color: #ff0000;\">\"Weigth 1: \"</span> + Str<span style=\"color: #000000;\">(</span> oNet:<span style=\"color: #000000;\">aLayers</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">2</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: #000000;\">aWeights</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">]</span> <span style=\"color: #000000;\">)</span> + ;<br /> CRLF + <span style=\"color: #ff0000;\">\"Output: \"</span> + Str<span style=\"color: #000000;\">(</span> oNet:<span style=\"color: #000000;\">aLayers</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">2</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: #000000;\">nOutput</span> <span style=\"color: #000000;\">)</span>,;<br /> <span style=\"color: #ff0000;\">\"Layer 2, 2nd neuron\"</span> + CRLF + <span style=\"color: #ff0000;\">\"Weight 1: \"</span> + Str<span style=\"color: #000000;\">(</span> oNet:<span style=\"color: #000000;\">aLayers</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">2</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: #000000;\">aWeights</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">]</span> <span style=\"color: #000000;\">)</span> + ;<br /> CRLF + <span style=\"color: #ff0000;\">\"Output: \"</span> + Str<span style=\"color: #000000;\">(</span> oNet:<span style=\"color: #000000;\">aLayers</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">2</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: #000000;\">nOutput</span> <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">}</span>,;<br /> <span style=\"color: #ff0000;\">\"Layer 3 1st neuron\"</span> + CRLF + <span style=\"color: #ff0000;\">\"Weigth 1: \"</span> + Str<span style=\"color: #000000;\">(</span> oNet:<span style=\"color: #000000;\">aLayers</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">3</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: #000000;\">aWeights</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">]</span> <span style=\"color: #000000;\">)</span> + ;<br /> CRLF + <span style=\"color: #ff0000;\">\"Weigth 2: \"</span> + Str<span style=\"color: #000000;\">(</span> oNet:<span style=\"color: #000000;\">aLayers</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">3</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: #000000;\">aWeights</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">2</span> <span style=\"color: #000000;\">]</span> <span style=\"color: #000000;\">)</span> + ;<br /> CRLF + <span style=\"color: #ff0000;\">\"Output: \"</span> + Str<span style=\"color: #000000;\">(</span> oNet:<span style=\"color: #000000;\">aLayers</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">2</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: #000000;\">nOutput</span> <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">}</span> <span style=\"color: #000000;\">)</span> ;<br /> SETUP <span style=\"color: #000000;\">(</span> oBrw:<span style=\"color: #000000;\">nDataLines</span> := <span style=\"color: #000000;\">4</span>,;<br /> oBrw:<span style=\"color: #000000;\">aCols</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">]</span>:<span style=\"color: #000000;\">nWidth</span> := <span style=\"color: #000000;\">180</span>,;<br /> oBrw:<span style=\"color: #000000;\">aCols</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">2</span> <span style=\"color: #000000;\">]</span>:<span style=\"color: #000000;\">nWidth</span> := <span style=\"color: #000000;\">180</span>,;<br /> oBrw:<span style=\"color: #000000;\">aCols</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">3</span> <span style=\"color: #000000;\">]</span>:<span style=\"color: #000000;\">nWidth</span> := <span style=\"color: #000000;\">180</span>,;<br /> oBrw:<span style=\"color: #000000;\">nMarqueeStyle</span> := <span style=\"color: #000000;\">3</span> <span style=\"color: #000000;\">)</span> <br /> <br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span></div>[/code:2s7helmi]\n\n[img:2s7helmi]https://bitbucket.org/fivetech/screenshots/downloads/neuralnet_browse.JPG[/img:2s7helmi]",
"time": "17:12",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Antonio Linares"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-06-24",
"forum": "AI Introduction (Harbour code and samples)",
"text": "[b:2wih07x9]Teaching a perceptron to multiply a number by 2:[/b:2wih07x9]\n\n[code=fw:2wih07x9]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"FiveWin.ch\"</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> oNeuron := TPerceptron<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;\">1</span> <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #00C800;\">local</span> n, nValue<br /><br /> <span style=\"color: #00C800;\">for</span> n = <span style=\"color: #000000;\">1</span> <span style=\"color: #0000ff;\">to</span> <span style=\"color: #000000;\">50</span><br /> oNeuron:<span style=\"color: #000000;\">Learn</span><span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">{</span> nValue := nRandom<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">1000</span> <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">}</span>, ExpectedResult<span style=\"color: #000000;\">(</span> nValue <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #00C800;\">next</span><br /><br /> <span style=\"color: #0000ff;\">MsgInfo</span><span style=\"color: #000000;\">(</span> oNeuron:<span style=\"color: #000000;\">aWeights</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">]</span> <span style=\"color: #000000;\">)</span><br /> <br /> <span style=\"color: #0000ff;\">MsgInfo</span><span style=\"color: #000000;\">(</span> oNeuron:<span style=\"color: #000000;\">Calculate</span><span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">{</span> <span style=\"color: #000000;\">5</span> <span style=\"color: #000000;\">}</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: #00C800;\">function</span> ExpectedResult<span style=\"color: #000000;\">(</span> nValue <span style=\"color: #000000;\">)</span><br /><br /><span style=\"color: #00C800;\">return</span> nValue * <span style=\"color: #000000;\">2</span><br /><br /><span style=\"color: #00C800;\">CLASS</span> TPerceptron<br /><br /> <span style=\"color: #00C800;\">DATA</span> aWeights<br /><br /> <span style=\"color: #00C800;\">METHOD</span> <span style=\"color: #00C800;\">New</span><span style=\"color: #000000;\">(</span> nInputs <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">METHOD</span> Learn<span style=\"color: #000000;\">(</span> aInputs, nExpectedResult <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">METHOD</span> Calculate<span style=\"color: #000000;\">(</span> aInputs <span style=\"color: #000000;\">)</span><br /><br /><span style=\"color: #00C800;\">ENDCLASS</span><br /><br /><span style=\"color: #00C800;\">METHOD</span> <span style=\"color: #00C800;\">New</span><span style=\"color: #000000;\">(</span> nInputs <span style=\"color: #000000;\">)</span> <span style=\"color: #00C800;\">CLASS</span> TPerceptron<br /><br /> <span style=\"color: #00C800;\">local</span> n<br /><br /> ::<span style=\"color: #000000;\">aWeights</span> = Array<span style=\"color: #000000;\">(</span> nInputs <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> nInputs<br /> ::<span style=\"color: #000000;\">aWeights</span><span style=\"color: #000000;\">[</span> n <span style=\"color: #000000;\">]</span> = <span style=\"color: #000000;\">0</span><br /> <span style=\"color: #00C800;\">next</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">Self</span><br /><br /><span style=\"color: #00C800;\">METHOD</span> Learn<span style=\"color: #000000;\">(</span> aInputs, nExpectedResult <span style=\"color: #000000;\">)</span> <span style=\"color: #00C800;\">CLASS</span> TPerceptron<br /><br /> <span style=\"color: #00C800;\">local</span> nSum := ::<span style=\"color: #000000;\">Calculate</span><span style=\"color: #000000;\">(</span> aInputs <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">if</span> nSum < nExpectedResult<br /> ::<span style=\"color: #000000;\">aWeights</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">]</span> += <span style=\"color: #000000;\">0.1</span><br /> <span style=\"color: #00C800;\">endif</span><br /><br /> <span style=\"color: #00C800;\">if</span> nSum > nExpectedResult<br /> ::<span style=\"color: #000000;\">aWeights</span><span style=\"color: #000000;\">[</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">]</span> -= <span style=\"color: #000000;\">0.1</span><br /> <span style=\"color: #00C800;\">endif</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span> <br /><br /><span style=\"color: #00C800;\">METHOD</span> Calculate<span style=\"color: #000000;\">(</span> aInputs <span style=\"color: #000000;\">)</span> <span style=\"color: #00C800;\">CLASS</span> TPerceptron<br /><br /> <span style=\"color: #00C800;\">local</span> n, nSum := <span style=\"color: #000000;\">0</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> aInputs <span style=\"color: #000000;\">)</span><br /> nSum += aInputs<span style=\"color: #000000;\">[</span> n <span style=\"color: #000000;\">]</span> * ::<span style=\"color: #000000;\">aWeights</span><span style=\"color: #000000;\">[</span> n <span style=\"color: #000000;\">]</span><br /> <span style=\"color: #00C800;\">next</span><br /><br /><span style=\"color: #00C800;\">return</span> nSum</div>[/code:2wih07x9]",
"time": "06:51",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Antonio Linares"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-06-28",
"forum": "AI Introduction (Harbour code and samples)",
"text": "Antonio,\n\n Inteligência Artificial\n\n<!-- m --><a class=\"postlink\" href=\"https://www.facebook.com/504184556441407/videos/568926636633865\">https://www.facebook.com/50418455644140 ... 6636633865</a><!-- m -->\n\n<!-- m --><a class=\"postlink\" href=\"https://www.youtube.com/watch?v=h0DyYLLf3m8\">https://www.youtube.com/watch?v=h0DyYLLf3m8</a><!-- m -->",
"time": "17:07",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Silvio.Falconi"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-07-17",
"forum": "AI Introduction (Harbour code and samples)",
"text": "[url:3alvrg4b]http://www.learnartificialneuralnetworks.com/neural-network-software/backpropagation-source-code/[/url:3alvrg4b]",
"time": "04:47",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Antonio Linares"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-07-21",
"forum": "AI Introduction (Harbour code and samples)",
"text": "[url:1wg8s8mx]https://github.com/alkresin/hrb4fann[/url:1wg8s8mx]\n\n[url:1wg8s8mx]http://leenissen.dk/[/url:1wg8s8mx]\n\n[url:1wg8s8mx]https://github.com/libfann/fann[/url:1wg8s8mx]\n\nFannTool:\n[url:1wg8s8mx]https://bitbucket.org/birolkuyumcu/fanntool/downloads/[/url:1wg8s8mx]\n\ndocumentation:\n[url:1wg8s8mx]https://sourceforge.net/projects/fann/files/fann_doc/1.0/fann_doc_complete_1.0.pdf[/url:1wg8s8mx]\n\n[url:1wg8s8mx]https://es.slideshare.net/bluekid/fann-tool-usersguide[/url:1wg8s8mx]",
"time": "04:55",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Antonio Linares"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-07-23",
"forum": "AI Introduction (Harbour code and samples)",
"text": "[b:39azm5uk]Scaled value:[/b:39azm5uk] ( Input Value - Minimum ) / ( Maximum - Minimum )\n\n[b:39azm5uk]Descaled value (Input Value):[/b:39azm5uk] ( Scaled value * ( Maximum - Minimum ) ) + Minimum",
"time": "10:11",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Antonio Linares"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-07-23",
"forum": "AI Introduction (Harbour code and samples)",
"text": "Test of scaling and descaling values:\n\nScaling: ( value - minimum ) / ( Maximum - Minimum )\n\n0 --> ( 0 - 0 ) / ( 9 - 0 ) --> 0\n1 --> ( 1 - 0 ) / ( 9 - 0 ) --> 0.111\n2 --> ( 2 - 0 ) / ( 9 - 0 ) --> 0.222\n3 --> ( 3 - 0 ) / ( 9 - 0 ) --> 0.333\n4 --> ( 4 - 0 ) / ( 9 - 0 ) --> 0.444\n5 --> ( 5 - 0 ) / ( 9 - 0 ) --> 0.555\n6 --> ( 6 - 0 ) / ( 9 - 0 ) --> 0.666\n7 --> ( 7 - 0 ) / ( 9 - 0 ) --> 0.777\n8 --> ( 8 - 0 ) / ( 9 - 0 ) --> 0.888\n9 --> ( 9 - 0 ) / ( 9 - 0 ) --> 1",
"time": "10:52",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Antonio Linares"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-08-04",
"forum": "AI Introduction (Harbour code and samples)",
"text": "In TensorFlow we have the [b:2dhjlltl]Softmax[/b:2dhjlltl] function which transforms the output of each unit to a value between 0 and 1, and makes the sum of all units equals 1. It will tell us the probability of each category\n\n[url:2dhjlltl]https://medium.com/@Synced/big-picture-machine-learning-classifying-text-with-neural-networks-and-tensorflow-da3358625601[/url:2dhjlltl]",
"time": "06:35",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Antonio Linares"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2017-09-02",
"forum": "AI Introduction (Harbour code and samples)",
"text": "Hola !\n\nArticulo interesante que ayuda a entrar en este mundillo... <!-- m --><a class=\"postlink\" href=\"https://blogs.elconfidencial.com/tecnologia/tribuna/2017-09-02/deep-learning-demonios-explicacion_1437007/\">https://blogs.elconfidencial.com/tecnol ... n_1437007/</a><!-- m -->\n\nSaludetes.",
"time": "20:23",
"topic": "Artificial intelligence - Class TPerceptron",
"username": "Carles"
}
] |
Artificial intelligence - Class TPerceptron
|
[
{
"date": "2007-07-24",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nAs I can define this function to use in the FWH/xHarbour ?\n\n[code:2hp6kag5]CreateTerWindow\n \n Open a TER Window:\n\nHWND CreateTerWindow(ptr)\n \n \n struct arg_list far *ptr;\n The ptr argument points to a structure that provides the initial parameters to open a window. This structure includes the following parameters:\n \n\n\n \nstruct arg_list {\n \n \n int x\n Initial X position of the editing window. You may specify CW_USEDEFAULT here to use the default value. The CW_USEDEFAULT constant is defined by Windows as hex 8000 for 16 bit and hex 80000000 for 32 bit.\n \n \n int y\n Initial Y position of the editing window. You may specify CW_USEDEFAULT here to use the default value.\n \n \n int width\n Window width. You may specify CW_USEDEFAULT here to use the default value\n \n \n int height\n Window Height. You may specify CW_USEDEFAULT here to use the default value.\n \n \n int LineLimit\n Maximum number of lines allowed for text editing. Set this field to 0 to allow unlimited number of lines.\n \n \n BOOL WordWrap\n If set to TRUE, this flag enables the word wrapping feature.\n \n \n BOOL PrintView\n Normally (PrintView = FALSE) the text lines are wrapped at the right edge of the window. This is a convenient editing mode with better performance. In the print view edit mode, however, the text lines are wrapped as they would be wrapped when printed at the current printer.\n \n \n BOOL PageMode\n Set to TRUE to facilitate editing of documents one page at a time. This feature is useful when editing multiple column documents. The text is displayed in side-by-side columns. This mode also implies the PrintView mode.\n \n \n BOOL FittedView\n Special case of the page mode in which the text wraps to the window width and the soft page breaks are not displayed\n \n \n BOOL ShowStatus\n If set to TRUE, the editor will display a status line describing the current cursor location, and the insert/overtype indicator.\n \n \n BOOL ShowMenu\n If set to TRUE, the editor displays the editor menu under the caption bar. When set to FALSE, the editor commands must be selected using only the accelerator keys.\n \n \n BOOL ShowHorBar\n If set to TRUE, the editor displays the horizontal scroll bar.\n \n \n BOOL ShowVerBar\n If set to TRUE, the editor displays the vertical scroll bar.\n \n \n BOOL ruler\n Set this variable to TRUE to show a ruler with tab stops.\n \n \n BOOL ToolBar\n Set this variable to TRUE to show the tool bar.\n \n \n BOOL UserCanClose\n Set this variable to TRUE if you want your user to be able to close the TER window by selecting the exit option from the TER menu. Otherwise, your application will need to close the window by using the CloseTer function.\n \n \n BOOL BorderMargins\n Set this field to TRUE to create a thin margin around the text area within the TER window. This margin area is for cosmetic purpose only.\n \n \n BOOL ReadOnly\n This is a browser mode which does not allow text modifications.\n \n \n int InitLine\n The first line number to position on when the TER routine is called.\n \n \n char InputType\n This field specifies the input type to the editor. If you wish to pass a text file name to the editor, set this flag to 'F'. However, if the text input will be passed in a global memory buffer, set this flag to 'B'.\n \n \n char file[129]\n If the InputType field is set to 'F', this field specifies the full path of the input file.\n \n \n HANDLE hBuffer\n If the InputType field is set to 'B', this field specifies the handle to the global memory containing the input text data. To specify an empty buffer, allocate a buffer for 1 byte, place the 'delim' character in the first byte and set the 'BufferLen' field to 1. The input memory handle must be unlocked before calling the editor routine. You can get the updated text by using the GetTerBuffer prior to closing the TER window.\n \n \n long BufferLen\n When the InputType field is set to 'B', the BufferLen field specifies the length of the input buffer.\n \n \n char delim\n This character should be be set to 13 (carriage return character).\n \n \n int SaveFormat\n This field determines the format of the output file or buffer:\n \n \n \n SAVE_DEFAULT:\n Save in the format of the input file.\n \n \n \n SAVE_TER:\n Save in the native TER format.\n \n \n \n SAVE_RTF:\n Save in the Rich Text Format.\n \n \n \n SAVE_TEXT:\n Save in ASCII format.\n \n \n \n SAVE_TEXT_LINES:\n Save in ASCII format with line breaks.\n \n \n \n SAVE_UTEXT\n Save in the Unicode text format (not available in 16 bit)\n \n \n HANDLE hInst\n Handle for the current instance of the application.\n \n \n HWND hParentWnd\n Handle of the parent window. The DLL sends the TER_CLOSE message to this function before closing a TER window (see the CloseTer API function).\n \n \n HWND hTextWnd\n The editor fills in this field with the window handle of the editor window. The editor does this as soon as the window is created. You will need this handle to use other TER API functions.\n \n \n DWORD style\n The window style that you provide here is simply passed to the CreateWindow function.\n \n \n char FontTypeFace[30]\n Default font typeface for the document. Example: \"Helv\", \"Courier\", \"System\" etc. A menu option in the TER window provides multiple selections of typeface and point sizes to choose from.\n \n \n int PointSize\n Point size of the default font. Please remember that 72 points are equal to one inch. Most written correspondences use a letter size of 10 or 12 points.\n \n \n BOOL open\n The editor set this variable to a TRUE value after initializing a TER window.\n \n \n BOOL modified\n This variable is reserved for internal use.\n \n}\n \n \n \n Description: This function opens a TER window.\n\nReturn Value: If successful, the function returns the window handle of the new window. Otherwise it returns a NULL value. The handle to the newly opened window is also returned to you using the hTextWnd variable within the arg_list structure. If your application provides the data using a global buffer, the handle to the specified global buffer becomes the property of the DLL. Your application MUST not try to lock or free this handle. To get the updated text data, you should use the GetTerBuffer function.\n\nComments: This function is not available as an ActiveX control method. It must be used as a DLL function.\n\n [/code:2hp6kag5]",
"time": "14:17",
"topic": "As I can define this function to use in the FWH/xHarbour ?",
"username": "vilian"
}
] |
As I can define this function to use in the FWH/xHarbour ?
|
[
{
"date": "2007-07-24",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Vilian,\n\nThe easiest way is to fill the C structure from C code:\n[code:2hxidul6]\n#pragma BEGINDUMP\n\n#include <windows.h>\n#include <hbapi.h>\n\nHB_FUNC( CREATETERWINDOW )\n{\n struct arg_list ptr;\n\n ... fill the ptr ... members using hb_par...( x ), i.e.:\n ptr.width = hb_parnl( 3 );\n\n hb_retnl( ( ULONG ) CreateTerWindow( &ptr ) ); \n}\n\n#pragma ENDDUMP\n[/code:2hxidul6]",
"time": "15:49",
"topic": "As I can define this function to use in the FWH/xHarbour ?",
"username": "Antonio Linares"
}
] |
As I can define this function to use in the FWH/xHarbour ?
|
[
{
"date": "2007-07-24",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nWhen I try to compile appear the following messages: \n\n[code:17v8cehx]Error E2450 \\\\tec2000\\\\sig50\\\\SIG241.PRG 1410: Undefined structure 'arg_list' in function HB_FUN_CREATETERWINDOW\nError E2449 \\\\tec2000\\\\sig50\\\\SIG241.PRG 1410: Size of 'ptr' is unknown or zero in function HB_FUN_CREATETERWINDOW\nError E2450 \\\\tec2000\\\\sig50\\\\SIG241.PRG 1410: Undefined structure 'arg_list' in function HB_FUN_CREATETERWINDOW\nError E2450 \\\\tec2000\\\\sig50\\\\SIG241.PRG 1410: Undefined structure 'arg_list' in function HB_FUN_CREATETERWINDOW\nError E2449 \\\\tec2000\\\\sig50\\\\SIG241.PRG 1410: Size of 'ptr' is unknown or zero in function HB_FUN_CREATETERWINDOW\nError E2451 \\\\tec2000\\\\sig50\\\\SIG241.PRG 1412: Undefined symbol 'x' in function HB_FUN_CREATETERWINDOW\nError E2451 \\\\tec2000\\\\sig50\\\\SIG241.PRG 1413: Undefined symbol 'y' in function HB_FUN_CREATETERWINDOW\nError E2451 \\\\tec2000\\\\sig50\\\\SIG241.PRG 1414: Undefined symbol 'width' in function HB_FUN_CREATETERWINDOW\nError E2451 \\\\tec2000\\\\sig50\\\\SIG241.PRG 1415: Undefined symbol 'height' in function HB_FUN_CREATETERWINDOW\nWarning W8065 \\\\tec2000\\\\sig50\\\\SIG241.PRG 1417: Call to function 'CreateTerWindow' with no prototype in function HB_FUN_CREATETERWINDOW\n[/code:17v8cehx]\n\nWhat I am making made a mistake?",
"time": "18:07",
"topic": "As I can define this function to use in the FWH/xHarbour ?",
"username": "vilian"
}
] |
As I can define this function to use in the FWH/xHarbour ?
|
[
{
"date": "2007-07-24",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Try it this way:\n[code:2it2b738]\n#pragma BEGINDUMP\n\n#include <windows.h>\n#include <hbapi.h>\n\nHWND CreateTerWindow( ... );\n\nHB_FUNC( CREATETERWINDOW )\n{\n hb_retnl( ( ULONG ) CreateTerWindow( hb_parnl( 1 ), // x\n hb_parnl( 2 ), // y\n hb_parnl( 3 ), // width\n hb_parnl( 4 ), // height\n hb_parnl( 5 ), // lineLimit\n hb_parl( 6 ), // WordWrap\n hb_parl( 7 ), // PrintView\n hb_parl( 8 ), // PageMode\n hb_parl( 9 ), // FittedView \n <continue you :-) >\n ) ); \n}\n\n#pragma ENDDUMP \n[/code:2it2b738]",
"time": "18:48",
"topic": "As I can define this function to use in the FWH/xHarbour ?",
"username": "Antonio Linares"
}
] |
As I can define this function to use in the FWH/xHarbour ?
|
[
{
"date": "2007-07-25",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nThanks.",
"time": "02:56",
"topic": "As I can define this function to use in the FWH/xHarbour ?",
"username": "vilian"
}
] |
As I can define this function to use in the FWH/xHarbour ?
|
[
{
"date": "2008-12-12",
"forum": "FiveWin for Harbour/xHarbour",
"text": "[quote=\"vilian\":305k87st]Antonio,\n\nThanks.[/quote:305k87st]\r\n\r\nHola Vilian,\r\n\r\nConseguistes funcionar CreateTerWindow() desde FWH?\r\n\r\nCómo?\r\n\r\n\r\nSaludos\r\nCarlos G.",
"time": "01:19",
"topic": "As I can define this function to use in the FWH/xHarbour ?",
"username": "FiveWiDi"
}
] |
As I can define this function to use in the FWH/xHarbour ?
|
[
{
"date": "2008-12-12",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Sim, o suporte de subsystem é excelente e ajudou muito.\r\n\r\n[code:30dxv44v]xDll := LoadLib32(\"TER15.DLL\")\n TerSetLicenceKey(\"XXXX-XXXX-XXXX\")\n\n DEFINE WINDOW oWndEdt TITLE \"Editor de Laudos\" MDICHILD OF oWnd\n\n DEFINE BUTTONBAR oBar 3D SIZE 22,27 TOP OF oWndEdt\n\n DEFINE BUTTON NAME \"OPEN\" OF oBar ;\n ACTION( AbrirLaudo(oWndEdt,oActivex) ) ;\n TOOLTIP \"Definir Laudos de Exames\" ;\n NOBORDER\n\n DEFINE BUTTON NAME \"AUTOTEXT\" OF oBar ;\n ACTION ( DefAutoText(cMedAtual,oWndEdt) );\n TOOLTIP \"Definir Auto-textos\" ;\n WHEN .NOT. Empty(cMedAtual) NOBORDER\n\n DEFINE BUTTON NAME \"BBASS\" OF oBar ;\n ACTION ( IncAssMed(cMedAtual,oWndEdt) ) ;\n TOOLTIP \"Incluir assinatura do médico no laudo\" ;\n WHEN .NOT. Empty(cMedAtual) NOBORDER\n\n DEFINE BUTTON NAME \"BBINIBAK\" OF oBar ;\n ACTION( GravaArquivo() ) ;\n TOOLTIP \"Salvar arquivo\" ;\n NOBORDER\n\n DEFINE BUTTON NAME \"BBCONS\" OF oBar ;\n ACTION( PesqLaudo(oWndEdt) ) ;\n TOOLTIP \"Pesquisar Laudos por paciente\" ;\n NOBORDER\n\n DEFINE BUTTON NAME \"BBPRINT\" OF oBar ;\n ACTION IF(GravaArquivo(.t.),oActiveX:Do(\"TerCommand\",ID_PRINT),NIL);\n TOOLTIP \"Imprimir laudos\" ;\n NOBORDER\n\n DEFINE BUTTON NAME \"BBPESQ\" OF oBar ;\n ACTION oActiveX:Do(\"TerCommand\",ID_PRINT_PREVIEW);\n TOOLTIP \"Visualizar impressão\" ;\n NOBORDER\n\n DEFINE BUTTON NAME \"UNDO\" OF oBar ;\n ACTION(oActiveX:Do(\"TerCommand\",ID_UNDO));\n TOOLTIP \"Desfaz\";\n NOBORDER;\n GROUP\n\n \tDEFINE BUTTON NAME \"REDO\" OF oBar ;\n\t ACTION(oActiveX:Do(\"TerCommand\",ID_REDO));\n TOOLTIP \"ReFaz\";\n\t NOBORDER\n\n DEFINE BUTTON oBtn NAME \"LINDUP\" OF oBar ;\n ACTION MudaTipoLinha(oBtn) ;\n TOOLTIP \"Espaço duplo entre linhas\";\n NOBORDER;\n GROUP\n\n DEFINE BUTTON NAME \"EXITEDT\" OF oBar ;\n ACTION ( FechaEditor() ) ;\n TOOLTIP \"Fechar/Sair do editor\";\n NOBORDER GROUP\n\n\n @ 7, 300 SAY oSayEdt PROMPT \"Chv:\" SIZE 160, 15 PIXEL OF oBar\n\n oActiveX = TActiveX():New( oWndEdt, \"TOC15.Toc15Ctrl.1\" )\n\n oWndEdt:oClient = oActiveX // To fill the entire window surface\n\n oActiveX:Do(\"TerCommand\",ID_RULER)\n oActiveX:Do(\"TerCommand\",ID_TOOL_BAR)\n oActiveX:Do(\"TerCommand\",ID_SHOW_PAGE_BORDER)\n oActiveX:Do(\"TerSetFlags4\",1,TFLAG4_ONE_ROW_TOOLBAR)\n oActiveX:Do(\"TerRecreateToolbar\",1)\n\n oActiveX:bOnEvent := { | event, aParams,nKey,nx,ny | EventInfo( event, aParams,oActiveX,nKey,nx,ny ) }\n\n oEditor := TEditor()\n oEditor:cAlias := \"AUT\"\n \t oEditor:Cargo := {NIL,NIL,cMedAtual}\n\n \t nHand := oActiveX:GetProp(\"hWnd\")\n\n ACTIVATE WINDOW oWndEdt MAXIMIZED[/code:30dxv44v]",
"time": "12:15",
"topic": "As I can define this function to use in the FWH/xHarbour ?",
"username": "vilian"
}
] |
As I can define this function to use in the FWH/xHarbour ?
|
[
{
"date": "2008-12-12",
"forum": "FiveWin for Harbour/xHarbour",
"text": "[quote=\"vilian\":1bya4kxv]Sim, o suporte de subsystem é excelente e ajudou muito.\n\n[code:1bya4kxv]xDll := LoadLib32(\"TER15.DLL\")\n TerSetLicenceKey(\"XXXX-XXXX-XXXX\")\n\n DEFINE WINDOW oWndEdt TITLE \"Editor de Laudos\" MDICHILD OF oWnd\n\n DEFINE BUTTONBAR oBar 3D SIZE 22,27 TOP OF oWndEdt\n\n DEFINE BUTTON NAME \"OPEN\" OF oBar ;\n ACTION( AbrirLaudo(oWndEdt,oActivex) ) ;\n TOOLTIP \"Definir Laudos de Exames\" ;\n NOBORDER\n\n DEFINE BUTTON NAME \"AUTOTEXT\" OF oBar ;\n ACTION ( DefAutoText(cMedAtual,oWndEdt) );\n TOOLTIP \"Definir Auto-textos\" ;\n WHEN .NOT. Empty(cMedAtual) NOBORDER\n\n DEFINE BUTTON NAME \"BBASS\" OF oBar ;\n ACTION ( IncAssMed(cMedAtual,oWndEdt) ) ;\n TOOLTIP \"Incluir assinatura do médico no laudo\" ;\n WHEN .NOT. Empty(cMedAtual) NOBORDER\n\n DEFINE BUTTON NAME \"BBINIBAK\" OF oBar ;\n ACTION( GravaArquivo() ) ;\n TOOLTIP \"Salvar arquivo\" ;\n NOBORDER\n\n DEFINE BUTTON NAME \"BBCONS\" OF oBar ;\n ACTION( PesqLaudo(oWndEdt) ) ;\n TOOLTIP \"Pesquisar Laudos por paciente\" ;\n NOBORDER\n\n DEFINE BUTTON NAME \"BBPRINT\" OF oBar ;\n ACTION IF(GravaArquivo(.t.),oActiveX:Do(\"TerCommand\",ID_PRINT),NIL);\n TOOLTIP \"Imprimir laudos\" ;\n NOBORDER\n\n DEFINE BUTTON NAME \"BBPESQ\" OF oBar ;\n ACTION oActiveX:Do(\"TerCommand\",ID_PRINT_PREVIEW);\n TOOLTIP \"Visualizar impressão\" ;\n NOBORDER\n\n DEFINE BUTTON NAME \"UNDO\" OF oBar ;\n ACTION(oActiveX:Do(\"TerCommand\",ID_UNDO));\n TOOLTIP \"Desfaz\";\n NOBORDER;\n GROUP\n\n \tDEFINE BUTTON NAME \"REDO\" OF oBar ;\n\t ACTION(oActiveX:Do(\"TerCommand\",ID_REDO));\n TOOLTIP \"ReFaz\";\n\t NOBORDER\n\n DEFINE BUTTON oBtn NAME \"LINDUP\" OF oBar ;\n ACTION MudaTipoLinha(oBtn) ;\n TOOLTIP \"Espaço duplo entre linhas\";\n NOBORDER;\n GROUP\n\n DEFINE BUTTON NAME \"EXITEDT\" OF oBar ;\n ACTION ( FechaEditor() ) ;\n TOOLTIP \"Fechar/Sair do editor\";\n NOBORDER GROUP\n\n\n @ 7, 300 SAY oSayEdt PROMPT \"Chv:\" SIZE 160, 15 PIXEL OF oBar\n\n oActiveX = TActiveX():New( oWndEdt, \"TOC15.Toc15Ctrl.1\" )\n\n oWndEdt:oClient = oActiveX // To fill the entire window surface\n\n oActiveX:Do(\"TerCommand\",ID_RULER)\n oActiveX:Do(\"TerCommand\",ID_TOOL_BAR)\n oActiveX:Do(\"TerCommand\",ID_SHOW_PAGE_BORDER)\n oActiveX:Do(\"TerSetFlags4\",1,TFLAG4_ONE_ROW_TOOLBAR)\n oActiveX:Do(\"TerRecreateToolbar\",1)\n\n oActiveX:bOnEvent := { | event, aParams,nKey,nx,ny | EventInfo( event, aParams,oActiveX,nKey,nx,ny ) }\n\n oEditor := TEditor()\n oEditor:cAlias := \"AUT\"\n \t oEditor:Cargo := {NIL,NIL,cMedAtual}\n\n \t nHand := oActiveX:GetProp(\"hWnd\")\n\n ACTIVATE WINDOW oWndEdt MAXIMIZED[/code:1bya4kxv][/quote:1bya4kxv]\r\n\r\nVilian,\r\n\r\nEsta noche lo pruebo.\r\n\r\nUm Grande Obrigado\r\nCarlos G.",
"time": "13:09",
"topic": "As I can define this function to use in the FWH/xHarbour ?",
"username": "FiveWiDi"
}
] |
As I can define this function to use in the FWH/xHarbour ?
|
[
{
"date": "2009-09-17",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Estoy usando un control activeX, y necesito llamar un metodo y pasarle un parmetro, dicho parametro espera recibirlo del tipo array de bytes (ByRef aRawData() As Byte) ).\n\nAlguna idea para pasarselo desde harbour. \nEl parametro es el contenido de un fichero binario. \nEn VB se hace de la siguiente forma:\n[code=fw:3sa6kv98]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br />Dim blob<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span> As Byte<br /> <span style=\"color: #ff0000;\">' Read binary data from file.<br /> Open CommonDialog1.FileName For Binary As #1<br /> ReDim blob(LOF(1))<br /> Get #1, , blob()<br /> Close #1<br /> Templ.Deserialize blob<br /></span></div>[/code:3sa6kv98]\nEsto mismo desde harbour y pasandole como parametro el contenido del fichero leido con fRead, no funciona.\n\nSi con el propio activex, ejecuto serialize y lo muevo a una variable, y despues la paso al activex si funciona. \n[code=fw:3sa6kv98]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br />cTmp:= oAx:<span style=\"color: #000000;\">Serialize</span><span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br />oAx:<span style=\"color: #000000;\">DeSearialize</span><span style=\"color: #000000;\">(</span> cTmp <span style=\"color: #000000;\">)</span> <span style=\"color: #B900B9;\">//Ok</span><br /> </div>[/code:3sa6kv98]\nCualquier otro parametro leido desde fichero, de otra variable, etc no fucniona, aunque en teoria son \"identicos\" en tamaño, etc.",
"time": "08:59",
"topic": "As byte",
"username": "Biel EA6DD"
}
] |
As byte
|
[
{
"date": "2009-09-18",
"forum": "FiveWin para Harbour/xHarbour",
"text": "<!-- l --><a class=\"postlink-local\" href=\"http://forums.fivetechsupport.com/viewtopic.php?f=3&t=16746\">viewtopic.php?f=3&t=16746</a><!-- l -->",
"time": "18:18",
"topic": "As byte",
"username": "Antonio Linares"
}
] |
As byte
|
[
{
"date": "2009-09-20",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Hola...\nPerdón por entrar a este post con otro tema...\nEscribo para comentarle a Biel que estuve mirando su blog y dejé un comentario en el topic de Compresión y descrompresión de ficheros Zip...\nTuve algunos problemitas con sus funciones, y quizá amablemente podría darme una mano.\nDesde ya muchas gracias, y nuevamente disculpas.\nSaludos,",
"time": "00:40",
"topic": "As byte",
"username": "jrestojeda"
}
] |
As byte
|
[
{
"date": "2009-09-21",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Esteban, te he contestado en el blog.",
"time": "11:49",
"topic": "As byte",
"username": "Biel EA6DD"
}
] |
As byte
|
[
{
"date": "2009-09-21",
"forum": "FiveWin para Harbour/xHarbour",
"text": "[quote=\"Antonio Linares\":3p4peptw]Biel,\n\nThis is obvious, but have you tried it in this order ?\n[code=fw:3p4peptw]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br />oTmp:<span style=\"color: #000000;\">Deserialize</span><span style=\"color: #000000;\">(</span> xVar2<span style=\"color: #000000;\">)</span> <span style=\"color: #B900B9;\">//Crash</span><br />oTmp:<span style=\"color: #000000;\">Deserialize</span><span style=\"color: #000000;\">(</span> xVar1<span style=\"color: #000000;\">)</span> <span style=\"color: #B900B9;\">//Runs Ok</span><br /> </div>[/code:3p4peptw][/quote:3p4peptw]\nNo funciona cambiando el orden, el control activex casca al pasarle el parametro, el parametro no es del tipo esperado y produce un error.\nEl tema es que una variable harbour es capaz de contener un valor valido, pero desde Harbour soy incapaz de genera ese tipo de dato.\nNo habria alguna manera desde una funcion de C retornar un tipo as byte, y colocarlo en una variable Harbour.",
"time": "11:59",
"topic": "As byte",
"username": "Biel EA6DD"
}
] |
As byte
|
[
{
"date": "2009-09-21",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Hola Biel...\n\nNo he probado esto, pero puedes intentar de esta manera...\n\n[code=fw:w34mz90n]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br />....<br />Serialize<span style=\"color: #000000;\">(</span> oAx, xVal <span style=\"color: #000000;\">)</span><br />...<br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><span style=\"color: #00D7D7;\">#include</span> <hbapi.h><br /><span style=\"color: #00D7D7;\">#include</span> <hbvm.h> <br /><br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">(</span> SERIALIZE <span style=\"color: #000000;\">)</span> <br /><span style=\"color: #000000;\">{</span> <br /> PHB_ITEM pObj = hb_param<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">1</span>, HB_IT_OBJECT <span style=\"color: #000000;\">)</span>;<br /> PHB_ITEM pStr = hb_param<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">2</span>, HB_IT_STRING <span style=\"color: #000000;\">)</span>;<br /><br /> hb_vmPushSymbol<span style=\"color: #000000;\">(</span> hb_dynsymGetSymbol<span style=\"color: #000000;\">(</span> <span style=\"color: #ff0000;\">\"SERIALIZE\"</span> <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span>; <br /> hb_vmPush<span style=\"color: #000000;\">(</span> pObj <span style=\"color: #000000;\">)</span>; <br /> hb_vmPush<span style=\"color: #000000;\">(</span> pStr <span style=\"color: #000000;\">)</span>;<br /> hb_vmFunction<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">)</span>; <br /><br /><span style=\"color: #000000;\">}</span> <br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP<br /> </div>[/code:w34mz90n]",
"time": "13:37",
"topic": "As byte",
"username": "Daniel Garcia-Gil"
}
] |
As byte
|
[
{
"date": "2009-09-21",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Biel,\n\nQue ActiveX es ? Hay demo de él ?",
"time": "14:21",
"topic": "As byte",
"username": "Antonio Linares"
}
] |
As byte
|
[
{
"date": "2009-09-21",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Biel,\n\nPensando en el asunto, has probado esto ?\n[code=fw:34pzwcio]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br />xVar2 := xVar1<br />oTmp:<span style=\"color: #000000;\">Deserialize</span><span style=\"color: #000000;\">(</span> xVar2 <span style=\"color: #000000;\">)</span><br /> </div>[/code:34pzwcio]",
"time": "14:52",
"topic": "As byte",
"username": "Antonio Linares"
}
] |
As byte
|
[
{
"date": "2009-09-22",
"forum": "FiveWin para Harbour/xHarbour",
"text": "[quote=\"Daniel Garcia-Gil\":10ul4lxa]Hola Biel...\n\nNo he probado esto, pero puedes intentar de esta manera...\n\n[code=fw:10ul4lxa]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br />....<br />Serialize<span style=\"color: #000000;\">(</span> oAx, xVal <span style=\"color: #000000;\">)</span><br />...<br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><span style=\"color: #00D7D7;\">#include</span> <hbapi.h><br /><span style=\"color: #00D7D7;\">#include</span> <hbvm.h> <br /><br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">(</span> SERIALIZE <span style=\"color: #000000;\">)</span> <br /><span style=\"color: #000000;\">{</span> <br /> PHB_ITEM pObj = hb_param<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">1</span>, HB_IT_OBJECT <span style=\"color: #000000;\">)</span>;<br /> PHB_ITEM pStr = hb_param<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">2</span>, HB_IT_STRING <span style=\"color: #000000;\">)</span>;<br /><br /> hb_vmPushSymbol<span style=\"color: #000000;\">(</span> hb_dynsymGetSymbol<span style=\"color: #000000;\">(</span> <span style=\"color: #ff0000;\">\"SERIALIZE\"</span> <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span>; <br /> hb_vmPush<span style=\"color: #000000;\">(</span> pObj <span style=\"color: #000000;\">)</span>; <br /> hb_vmPush<span style=\"color: #000000;\">(</span> pStr <span style=\"color: #000000;\">)</span>;<br /> hb_vmFunction<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">)</span>; <br /><br /><span style=\"color: #000000;\">}</span> <br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP<br /> </div>[/code:10ul4lxa][/quote:10ul4lxa]\nHola Daniel, gracias por tu sugerencia, lo he probado y da el mismo error que si le paso al activex una cadena de caracteres.",
"time": "17:14",
"topic": "As byte",
"username": "Biel EA6DD"
}
] |
As byte
|
[
{
"date": "2009-09-22",
"forum": "FiveWin para Harbour/xHarbour",
"text": "[quote=\"Antonio Linares\":3biwmw41]Biel,\n\nPensando en el asunto, has probado esto ?\n[code=fw:3biwmw41]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br />xVar2 := xVar1<br />oTmp:<span style=\"color: #000000;\">Deserialize</span><span style=\"color: #000000;\">(</span> xVar2 <span style=\"color: #000000;\">)</span><br /> </div>[/code:3biwmw41][/quote:3biwmw41]\nSi, esto lo habia probado y funciona ok. \nIntentare enviarte el Activex.",
"time": "17:16",
"topic": "As byte",
"username": "Biel EA6DD"
}
] |
As byte
|
[
{
"date": "2009-09-22",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Biel,\n\nMe parece que es un bug generado entre el soporte de OLE y el ItemApi. Te explico mis razones:\n\n1. El valor que viene devuelto del ActiveX se pasa de Variant a Item de Harbour/xHarbour usando: hb_oleVariantToItem()\n\n2. Puesto que es de tipo \"C\", se ha llamado a la función hb_itemPutCPtr(): \n[code=fw:1exkgrmk]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br /> <span style=\"color: #00C800;\">case</span> VT_BSTR:<br /> <span style=\"color: #000000;\">{</span><br /> char* szString = WideToAnsi<span style=\"color: #000000;\">(</span> pVariant->n1.n2.n3.bstrVal <span style=\"color: #000000;\">)</span>;<br /> hb_itemPutCPtr<span style=\"color: #000000;\">(</span> pItem, szString <span style=\"color: #000000;\">)</span>;<br /> <span style=\"color: #00C800;\">break</span>;<br /> <span style=\"color: #000000;\">}</span><br /> </div>[/code:1exkgrmk]\n\n3. Y el bug finalmente se produce por contener ceros la cadena, en estas líneas de hb_itemPutCPtr(): \n[code=fw:1exkgrmk]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br /> ulLen = szText ? <span style=\"color: #0000ff;\">strlen</span><span style=\"color: #000000;\">(</span> szText <span style=\"color: #000000;\">)</span> : <span style=\"color: #000000;\">0</span>; <span style=\"color: #B900B9;\">// no se deberia usar strlen() pues no reconoce ceros dentro de la cadena</span><br /> pItem->item.asString.length = ulLen; <span style=\"color: #B900B9;\">// incorrecto! </span><br /> ...<br /> pItem->item.asString.value = szText; <span style=\"color: #B900B9;\">// el puntero se asigna tal cual, luego conserva todos los bytes</span><br /> </div>[/code:1exkgrmk]\nResumiendo: el contenido del item cadena y su longitud no se corresponden \n\nHay que reportarlo a las listas de Harbour y xHarbour para que se verifique este bug y en caso afirmativo, que se corrija.\n\nY gracias a ti por haberlo puesto de manifiesto <!-- s:-) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":-)\" title=\"Smile\" /><!-- s:-) -->",
"time": "18:19",
"topic": "As byte",
"username": "Antonio Linares"
}
] |
As byte
|
[
{
"date": "2009-09-22",
"forum": "FiveWin para Harbour/xHarbour",
"text": "[url:1r1ocu1n]http://www.matrixlist.com/pipermail/harbour/2009-September/025325.html[/url:1r1ocu1n]",
"time": "18:33",
"topic": "As byte",
"username": "Antonio Linares"
}
] |
As byte
|
[
{
"date": "2009-09-23",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Biel,\n\nEste cambio en olecore.c deberia solucionar el bug:\n[code=fw:12t53931]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br /> <span style=\"color: #00C800;\">case</span> VT_BSTR:<br /> <span style=\"color: #000000;\">{</span><br /> char* szString = WideToAnsi<span style=\"color: #000000;\">(</span> pVariant->n1.n2.n3.bstrVal <span style=\"color: #000000;\">)</span>;<br /> hb_itemPutCLPtr<span style=\"color: #000000;\">(</span> pItem, szString, WideCharToMultiByte<span style=\"color: #000000;\">(</span><br />CP_ACP, <span style=\"color: #000000;\">0</span>, pVariant->n1.n2.n3.bstrVal, <span style=\"color: #000000;\">-1</span>, <span style=\"color: #00C800;\">NULL</span>, <span style=\"color: #000000;\">0</span>, <span style=\"color: #00C800;\">NULL</span>, <span style=\"color: #00C800;\">NULL</span> <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span>;<br /> <span style=\"color: #00C800;\">break</span>;<br /> <span style=\"color: #000000;\">}</span><br /> </div>[/code:12t53931]",
"time": "01:29",
"topic": "As byte",
"username": "Antonio Linares"
}
] |
As byte
|
[
{
"date": "2009-09-23",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Muchas gracias Antonio por el tiempo dedicado, para mi hubiera sido imposible localizarlo. \nNo he podido comprobar el funcionamiento, hoy salgo de viaje, pero cuando regrese de Andorra, interar compilar los cambios y te comento.",
"time": "15:14",
"topic": "As byte",
"username": "Biel EA6DD"
}
] |
As byte
|
[
{
"date": "2009-09-23",
"forum": "FiveWin para Harbour/xHarbour",
"text": "Biel,\n\nEl bug fué arreglado unos dias antes en el propio repositorio de Harbour <!-- s:-) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":-)\" title=\"Smile\" /><!-- s:-) -->\n\nSolo hay que volver a construir un nuevo build de Harbour y listo <!-- s:-) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":-)\" title=\"Smile\" /><!-- s:-) -->",
"time": "17:12",
"topic": "As byte",
"username": "Antonio Linares"
}
] |
As byte
|
[
{
"date": "2006-07-24",
"forum": "FiveWin for Harbour/xHarbour",
"text": "WaitRun(iexplore()+\"http://www.aduanet.gob.pe/aduanas/sgdbf/Vehiculos.zip\")\n\nAs download a file from xharbour in a fixed route without q the users the route",
"time": "15:39",
"topic": "As download a file from xharbour in a fixed route without q",
"username": "Vladimir Zorrilla"
}
] |
As download a file from xharbour in a fixed route without q
|
[
{
"date": "2007-07-27",
"forum": "FiveWin for Harbour/xHarbour",
"text": "hi,\n\nI need to catch the return of the following command: \n \n oActiveX:Do(\"TerSearchReplace2\",\"rich\",\"\",SRCH_SEARCH,N,0)\n\nAccording to documentation of the [b:r6eul5q6]TerSearchReplace2[/b:r6eul5q6] component would have to return a numerical value.",
"time": "20:39",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-07-27",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Vilian,\n\nTry:\n\nMsgInfo( oActiveX:Do(\"TerSearchReplace2\",\"rich\",\"\",SRCH_SEARCH,N,0) )",
"time": "21:25",
"topic": "As to catch return of oActiveX:Do",
"username": "Antonio Linares"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-07-27",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nAlready I tried thus and is returning NIL.",
"time": "21:29",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-07-30",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nStudying activex.prg with the aid of the Gilmer, we perceive that the Do() method treats only 4(four) parameters. But necessary TerSearchReplace2 of 5(five). We try to make thus:\n\n nPos := ActXInvoke( ActXPdisp( oActiveX:hActiveX ),\"TerSearchReplace2\",\"rich\",\"\",SRCH_SEARCH,N,0)\n\nBut also it did not function. You can help me?",
"time": "19:45",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-07-31",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Vilian,\n\nAre you using Harbour or xHarbour ?",
"time": "08:43",
"topic": "As to catch return of oActiveX:Do",
"username": "Antonio Linares"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-07-31",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nI use xHarbour.",
"time": "12:18",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-07-31",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Vilian,\n\nPlease do this: tlib fivehc.lib - ole.obj \n\nthen add these functions to your app:\n[code:3lygq5xq]\nfunction OleGetProperty( hObj, cPropName )\n\n local o := TOleAuto()\n local uRet\n\n o:hObj = hObj\n uRet = __ObjSendMsg( o, cPropName )\n o:hObj = nil\n\nreturn uRet\n\nfunction OleSetProperty( hObj, cPropName, uValue )\n\n local o := TOleAuto()\n local uRet\n\n o:hObj = hObj\n uRet = __ObjSendMsg( o, \"_\" + cPropName, uValue )\n o:hObj = nil\n\nreturn uRet \n\nfunction OleInvoke( hObj, cMethName, ... )\n\n local o := TOleAuto()\n local uRet\n\n o:hObj = hObj\n uRet = o:Invoke( cMethName, ... )\n o:hObj = nil\n\nreturn uRet \n[/code:3lygq5xq]",
"time": "13:01",
"topic": "As to catch return of oActiveX:Do",
"username": "Antonio Linares"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-07-31",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nLater that I made what you asked for started to occur the following error:\n\n[code:2j2av2ya]Application\n===========\n Path and name: F:\\FWH\\SAMPLES\\pdf.exe (32 bits)\n Size: 1,306,624 bytes\n Time from start: 0 hours 0 mins 0 secs \n Error occurred at: 07/31/07, 09:38:02\n Error description: Error /16389 E_FAIL: TERCOMMAND\n Args:\n [ 1] = N 680\n [ 2] = U \n [ 3] = U \n [ 4] = U \n [ 5] = U \n\nStack Calls\n===========\n Called from: win32ole.prg => TOLEAUTO:TERCOMMAND(0)\n Called from: => HB_EXECFROMARRAY(0)\n Called from: win32ole.prg => TOLEAUTO:INVOKE(397)\n Called from: => ACTXINVOKE(67)\n Called from: ACTIVEX.PRG => TACTIVEX:DO(0)\n Called from: pdf.prg => MAIN(16)[/code:2j2av2ya]",
"time": "13:32",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-07-31",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nI changed OleInvoke for the following one: \n \n[code:288w5goi]function OleInvoke( hObj, cMethName, uPar1, uPar2, uPar3, uPar4, uPar5 )\n\n local o := TOleAuto()\n local uRet\n\n o:hObj = hObj\n IF uPar2 # NIL\n uRet = o:Invoke( cMethName, uPar1, uPar2, uPar3, uPar4, uPar5 )\n ELSE\n uRet = o:Invoke( cMethName, uPar1 )\n ENDIF\n o:hObj = nil\n\nreturn uRet[/code:288w5goi]\n\nThe error message stopped to happen, but I continue not receiving the return correct. I tried the following one:\n\n[code:288w5goi]STATIC FUNCTION EventInfo(event, aParams,oActiveX,oWnd,nKey,nx,ny)\nLOCAL nSt,text:=Space(100),font:=\"\",n\n\n IF Upper(event) $ \"KEYPRESS\"\n ? oActiveX:Do(\"TerSearchReplace2\",\"rich\",\"\",SRCH_SEARCH,N,0)\n ENDIF\n\nRETURN NIL[/code:288w5goi]\n\nIt did not function, then I made as a test(see bellow), but also it did not function.\n\n[code:288w5goi]STATIC FUNCTION EventInfo(event, aParams,oActiveX,oWnd,nKey,nx,ny)\nLOCAL nSt,text:=Space(100),font:=\"\",n\n\n IF Upper(event) $ \"KEYPRESS\"\n ? OleInvoke(oActivex:hWnd,\"TerSearchReplace2\",\"rich\",\"\",SRCH_SEARCH,N,0)\n ENDIF\n\nRETURN NIL[/code:288w5goi]",
"time": "13:51",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-07-31",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Vilian,\n\n> ? OleInvoke(oActivex:hWnd, ...\n\nThat is not correct, as the first parameter is NOT the hWnd.\n\nIt has to be OleInvoke( ActXPdisp( oActivex:hActiveX ), ...",
"time": "14:39",
"topic": "As to catch return of oActiveX:Do",
"username": "Antonio Linares"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-07-31",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nVery grateful. Now he was ok.",
"time": "14:59",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-02",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nNow necessary to implement keyboard key accelerator(Sample: CTRL+P to print). I made thus:\n\n[code:1sohd6hx]\noActiveX:bOnEvent := { | event, nKey | EventInfo( event, nKey ) }\n\nSTATIC FUNCTION EventInfo(event, nKey)\n\n IF Upper(event) $ \"KEYPRESS,KEYDOWN\"\n\n IF nKey = 80\n .....\n ENDIF\n\n ENDIF\n\nRETURN NIL\n\n[/code:1sohd6hx]\n[b:1sohd6hx]event[/b:1sohd6hx] is ok, But [b:1sohd6hx]nKey[/b:1sohd6hx] is returning NULL!",
"time": "21:37",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-02",
"forum": "FiveWin for Harbour/xHarbour",
"text": "have you tried with two params ?\n\noActiveX:bOnEvent := { | event, nKey1, nKey2 | EventInfo( event, nKey1, nKey2 ) }",
"time": "22:46",
"topic": "As to catch return of oActiveX:Do",
"username": "Antonio Linares"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-03",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nYes, i tried with four params.\n\noActiveX:bOnEvent := { | event, nKey1, nKey2, nKey3, nKey4 | EventInfo( event, nKey1, nKey2, nKey3, nKey4 ) }\n\nThe return is:\n\nnKey1 = array empty\nnKey2 = 1242696 ever(constant)\nnKey3 = NIL\nnKey4 = NIL",
"time": "02:14",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-03",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Vilian,\n\nAnalize the value 1242696 according to WM_KEYDOWN docs:\n<!-- m --><a class=\"postlink\" href=\"http://msdn2.microsoft.com/en-us/library/ms646280.aspx\">http://msdn2.microsoft.com/en-us/library/ms646280.aspx</a><!-- m -->\nunless that activex provides different parameters",
"time": "07:53",
"topic": "As to catch return of oActiveX:Do",
"username": "Antonio Linares"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-03",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nI verified the topic that you he suggested, I identified some functions for the treatment of messages, but I did not understand as they can help me !",
"time": "12:54",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-03",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Vilian,\n\nDo you always get 1242696 no matter what key you press ?",
"time": "14:30",
"topic": "As to catch return of oActiveX:Do",
"username": "Antonio Linares"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-03",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nany one.",
"time": "14:34",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-03",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Do you get that value without pressing a key ?\n\nWhat documentation about such event does your activex provides ?",
"time": "16:51",
"topic": "As to catch return of oActiveX:Do",
"username": "Antonio Linares"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-03",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nOn these specific events the following text only exists:\n\n[code:21dqwyrg]Standard events: \n\nThe control supports these standard events: Click, Double click, Got Focus, and Lost Focus, KeyDown, KeyPress, KeyUp. The KeyDown, KeyPress and KeyUp event take one integer parameter which passes the value of the key code.\n[/code:21dqwyrg]\n\nThe support technician of them returned me the following one:\n\n[code:21dqwyrg] KeyPress event is not an internal TE message (it is only an ActiveX message), it would not be routed to the callback message. The KeyPress event takes only one parameter which is the keyvalue for the keystroke. So nKey1 should be the numeric key values.[/code:21dqwyrg]\n\n\n I tested this event in Visual Basic and it seems to work properly. However, VB shows only one parameter, which is nKey.",
"time": "19:03",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-03",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Vilian,\n\nYou may need to modify these methods in Class TActiveX:\n\nMETHOD KeyChar() VIRTUAL\nMETHOD KeyDown() VIRTUAL",
"time": "19:18",
"topic": "As to catch return of oActiveX:Do",
"username": "Antonio Linares"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-03",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nI made the modification, but nothing he modified in the result.",
"time": "19:35",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-03",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Vilian,\n\nI don't know, don't have more ideas <!-- s:-( --><img src=\"{SMILIES_PATH}/icon_sad.gif\" alt=\":-(\" title=\"Sad\" /><!-- s:-( -->\n\nThats the problem with ActiveX (same as old Microsoft VBXs). We don't have their source code and we don't have full control over them",
"time": "20:27",
"topic": "As to catch return of oActiveX:Do",
"username": "Antonio Linares"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-03",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nIf you to install the control in its computer help to decide the problem?",
"time": "20:34",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-03",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Antonio,\n\nI asked to the support of them - Exists some another way to implement what necessary?\n\nThe support technician of them returned me the following one:\n\n[code:12kvpa9c]\n\n If your application lets you define callback function, then you can use the TerRegisterMsgCallback function to register your callback function. TE would then route the internal TE messages to the callback function. The callback function should have the following prototypes:\n\nLRESULT WINAPI _export TerCallback(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)\n\n Also, since KeyPress event is not an internal TE message (it is only an ActiveX message), it would not be routed to the callback message. You can instead use the PreProcess event for this purpose.[/code:12kvpa9c]\n\nAid?",
"time": "20:40",
"topic": "As to catch return of oActiveX:Do",
"username": "vilian"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2007-08-03",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Vilian,\n\n> You can instead use the PreProcess event for this purpose.\n\nWhats that ? Tell him to explain you whats the PreProcess event and a sample of its use",
"time": "22:29",
"topic": "As to catch return of oActiveX:Do",
"username": "Antonio Linares"
}
] |
As to catch return of oActiveX:Do
|
[
{
"date": "2022-08-28",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Hello friends,\nAs your functions/methods become more complex, splitting up, preprocessing and patching helps to simplify source code.\nBest regards,\nOtto\n\n\n[url:3acgq6ut]https://www.facebook.com/groups/modharbour.club/?multi_permalinks=1190790684808490[/url:3acgq6ut]",
"time": "14:18",
"topic": "As your functions/methods become more complex",
"username": "Otto"
}
] |
As your functions/methods become more complex
|
[
{
"date": "2022-08-30",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Hello friends,\nHere you can see an example of how to simplify a really complex source code like xBrowse with a patcher.\nBest regards,\nOtto\n\n[img:1du4aww0]https://mybergland.com/harbourinoxbrowse_clip3.jpg[/img:1du4aww0]\n\n[img:1du4aww0]https://mybergland.com/harbourinoxbrowse_clip4.jpg[/img:1du4aww0]\n\n[img:1du4aww0]https://mybergland.com/harbourinoxbrowse_clip5.jpg[/img:1du4aww0]\n\n[img:1du4aww0]https://mybergland.com/harbourinoxbrowse_clip6.jpg[/img:1du4aww0]\n\n[img:1du4aww0]https://mybergland.com/harbourinoxbrowse_clip7.jpg[/img:1du4aww0]",
"time": "10:45",
"topic": "As your functions/methods become more complex",
"username": "Otto"
}
] |
As your functions/methods become more complex
|
[
{
"date": "2019-06-11",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Hi, all !\n\nVBA (Excel) has an AscW() function. It is used to obtain the Unicode character code. How do I do this on FW ?",
"time": "11:57",
"topic": "AscW() function",
"username": "Natter"
}
] |
AscW() function
|
[
{
"date": "2019-06-11",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Please try\n[code=fw:3igwcobk]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br />HB_UTF8CHR<span style=\"color: #000000;\">(</span> nChar <span style=\"color: #000000;\">)</span><br /> </div>[/code:3igwcobk]\nMaybe that is what you are looking for.",
"time": "14:20",
"topic": "AscW() function",
"username": "nageswaragunupudi"
}
] |
AscW() function
|
[
{
"date": "2019-06-11",
"forum": "FiveWin for Harbour/xHarbour",
"text": "[url=https://docs.microsoft.com/it-it/dotnet/api/microsoft.visualbasic.strings.ascw?view=netframework-4.8:16ayodgd]AscW[/url:16ayodgd] return the unicode value from character or string. I think the Harbour version is HB_UTF8ASC:\n[code=fw:16ayodgd]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\">HB_UTF8ASC<span style=\"color: #000000;\">(</span> <cUtf8> <span style=\"color: #000000;\">)</span> -> <nUnicode></div>[/code:16ayodgd]\nHB_UTF8CHR is:\n[code=fw:16ayodgd]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\">HB_UTF8CHR<span style=\"color: #000000;\">(</span> <nUniVal> <span style=\"color: #000000;\">)</span> -> <cUtf8Char></div>[/code:16ayodgd]",
"time": "14:31",
"topic": "AscW() function",
"username": "AntoninoP"
}
] |
AscW() function
|
[
{
"date": "2019-06-11",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Yes, Mr. Antonio\nAnd thanks for the correction.",
"time": "14:34",
"topic": "AscW() function",
"username": "nageswaragunupudi"
}
] |
AscW() function
|
[
{
"date": "2019-06-11",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Yes, the HB_UTF8Asc() function suits me, but it is not available for FWH18.06",
"time": "14:42",
"topic": "AscW() function",
"username": "Natter"
}
] |
AscW() function
|
[
{
"date": "2019-06-11",
"forum": "FiveWin for Harbour/xHarbour",
"text": "This is not FWH function.\nThis is a Harbour function available both in Harbour and xHarbour.",
"time": "14:44",
"topic": "AscW() function",
"username": "nageswaragunupudi"
}
] |
AscW() function
|
[
{
"date": "2019-06-11",
"forum": "FiveWin for Harbour/xHarbour",
"text": "I downloaded xHarbour Binaries 1.2.3 Rev. 10252 for BCC 5.8.2 with xharbour.org But when linking the hb_utf8asc function is not detected",
"time": "15:53",
"topic": "AscW() function",
"username": "Natter"
}
] |
AscW() function
|
[
{
"date": "2019-06-11",
"forum": "FiveWin for Harbour/xHarbour",
"text": "I confirm: there is no hb_utf8asc() function in xHarbour. I can try to add it to xHarbour, if you really need it.\n\nEMG",
"time": "16:09",
"topic": "AscW() function",
"username": "Enrico Maria Giordano"
}
] |
AscW() function
|
[
{
"date": "2019-06-11",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Yes, I do. I will be very grateful to you",
"time": "17:48",
"topic": "AscW() function",
"username": "Natter"
}
] |
AscW() function
|
[
{
"date": "2019-06-11",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Ok, I'll see what I can do...\n\nEMG",
"time": "18:18",
"topic": "AscW() function",
"username": "Enrico Maria Giordano"
}
] |
AscW() function
|
[
{
"date": "2019-06-11",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Please, try this function and let me know if there are any problems:\n\n[code=fw:32iwsqm5]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"Fivewin.ch\"</span><br /><br /><br /><span style=\"color: #00C800;\">FUNCTION</span> MAIN<span style=\"color: #000000;\">(</span><span style=\"color: #000000;\">)</span><br /><br /> ? HB_UTF8ASC<span style=\"color: #000000;\">(</span> <span style=\"color: #ff0000;\">\"A\"</span> <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">RETURN</span> <span style=\"color: #00C800;\">NIL</span><br /><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><br /><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"error.ch\"</span><br /><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"hbapierr.h\"</span><br /><br /><br /><span style=\"color: #00C800;\">static</span> BOOL utf8tou16nextchar<span style=\"color: #000000;\">(</span> UCHAR ucChar, int * n, USHORT * uc <span style=\"color: #000000;\">)</span><br /><span style=\"color: #000000;\">{</span><br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> *n > <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">(</span> ucChar & 0xc0 <span style=\"color: #000000;\">)</span> != 0x80 <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">FALSE</span>;<br /> *uc = <span style=\"color: #000000;\">(</span> *uc << <span style=\"color: #000000;\">6</span> <span style=\"color: #000000;\">)</span> | <span style=\"color: #000000;\">(</span> ucChar & 0x3f <span style=\"color: #000000;\">)</span>;<br /> <span style=\"color: #000000;\">(</span> *n <span style=\"color: #000000;\">)</span>--;<br /> <span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">TRUE</span>;<br /> <span style=\"color: #000000;\">}</span><br /><br /> *n = <span style=\"color: #000000;\">0</span>;<br /> *uc = ucChar;<br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ucChar >= 0xc0 <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ucChar < 0xe0 <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> *uc &= 0x1f;<br /> *n = <span style=\"color: #000000;\">1</span>;<br /> <span style=\"color: #000000;\">}</span><br /> <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ucChar < 0xf0 <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> *uc &= 0x0f;<br /> *n = <span style=\"color: #000000;\">2</span>;<br /> <span style=\"color: #000000;\">}</span><br /> <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ucChar < 0xf8 <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> *uc &= 0x07;<br /> *n = <span style=\"color: #000000;\">3</span>;<br /> <span style=\"color: #000000;\">}</span><br /> <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ucChar < 0xfc <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> *uc &= 0x03;<br /> *n = <span style=\"color: #000000;\">4</span>;<br /> <span style=\"color: #000000;\">}</span><br /> <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ucChar < 0xfe <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> *uc &= 0x01;<br /> *n = <span style=\"color: #000000;\">5</span>;<br /> <span style=\"color: #000000;\">}</span><br /> <span style=\"color: #000000;\">}</span><br /> <span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">TRUE</span>;<br /><span style=\"color: #000000;\">}</span><br /><br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">(</span> HB_UTF8ASC <span style=\"color: #000000;\">)</span><br /><br /><span style=\"color: #000000;\">{</span><br /><br /> const char * pszString = hb_parc<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">)</span>;<br /><br /><br /><br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> pszString <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #000000;\">{</span><br /><br /> HB_SIZE nLen = hb_parclen<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">)</span>;<br /><br /> USHORT wc = <span style=\"color: #000000;\">0</span>;<br /><br /> int n = <span style=\"color: #000000;\">0</span>;<br /><br /><br /><br /> <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">(</span> nLen <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #000000;\">{</span><br /><br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ! utf8tou16nextchar<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">(</span> unsigned char <span style=\"color: #000000;\">)</span> *pszString, &n, &wc <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">break</span>;<br /><br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> n == <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">)</span><br /><br /> <span style=\"color: #00C800;\">break</span>;<br /><br /> pszString++;<br /><br /> nLen--;<br /><br /> <span style=\"color: #000000;\">}</span><br /><br /> hb_retnint<span style=\"color: #000000;\">(</span> wc <span style=\"color: #000000;\">)</span>;<br /><br /> <span style=\"color: #000000;\">}</span><br /><br /> <span style=\"color: #00C800;\">else</span><br /><br /> hb_errRT_BASE_SubstR<span style=\"color: #000000;\">(</span> EG_ARG, <span style=\"color: #000000;\">3012</span>, <span style=\"color: #00C800;\">NULL</span>, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS <span style=\"color: #000000;\">)</span>;<br /><br /><span style=\"color: #000000;\">}</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP</div>[/code:32iwsqm5]\n\nEMG",
"time": "22:15",
"topic": "AscW() function",
"username": "Enrico Maria Giordano"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Latin's fine. However, this function returns incorrect Unicode Cyrillic characters",
"time": "08:37",
"topic": "AscW() function",
"username": "Natter"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Can you send me a sample showing the problem, please?\n\nEMG",
"time": "09:07",
"topic": "AscW() function",
"username": "Enrico Maria Giordano"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Working correctly for me with this test:\n[code=fw:2u3b65fi]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><br /> <span style=\"color: #00C800;\">local</span> n, c<br /><br /> n := 0xE100<br /> c := HB_UTF8CHR<span style=\"color: #000000;\">(</span> n <span style=\"color: #000000;\">)</span><br /><br /> ? HB_UTF8ASC<span style=\"color: #000000;\">(</span> HB_UTF8CHR<span style=\"color: #000000;\">(</span> n <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span> == n <span style=\"color: #B900B9;\">// --> .T.</span><br /> ? HB_UTF8CHR<span style=\"color: #000000;\">(</span> HB_UTF8ASC<span style=\"color: #000000;\">(</span> c <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span> == c <span style=\"color: #B900B9;\">// --> .T.</span><br /> </div>[/code:2u3b65fi]",
"time": "09:34",
"topic": "AscW() function",
"username": "nageswaragunupudi"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "I didn't understand. There is a character with a code of 128 (1 byte) If you convert this character to Unicode it will consist of 2 bytes and its code will be 1040. How can I do this through the HB_UTF8ASC function() ?",
"time": "10:15",
"topic": "AscW() function",
"username": "Natter"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Sorry, I'm not familiar with Unicode. Just give me a sample showing the problem and I'll see what I can do.\n\nEMG",
"time": "10:45",
"topic": "AscW() function",
"username": "Enrico Maria Giordano"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "From the beginning, we are going in the wrong direction. I am sorry for this deviation.\nThis is not conversion to and from UTF8 but of WideChar. (16bit char encoding).\nWindows internally works with WideChar, i.e., 64 bit (little endian) characters.\n\nIn 8bit notation\n\n\"AB\" is \"4142\" in hex\n\nIn 16bit notation\n\n\"AB\" is \"41004200\" in hex",
"time": "10:48",
"topic": "AscW() function",
"username": "nageswaragunupudi"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "So, what's the point?\n\nEMG",
"time": "10:59",
"topic": "AscW() function",
"username": "Enrico Maria Giordano"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "BIN2W( cWideString ) should give the value equivalent to AscW()",
"time": "12:40",
"topic": "AscW() function",
"username": "nageswaragunupudi"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "This small program demonstrates that BIN2W() works like AscW()\n[code=fw:jekzyezc]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"fivewin.ch\"</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> cUtf8, cWide, nAsc<br /><br /> cUtf8 := <span style=\"color: #ff0000;\">\"?\"</span><br /> ? cUtf8<br /> cWide := UTF8TOUTF16<span style=\"color: #000000;\">(</span> cUtf8 <span style=\"color: #000000;\">)</span><br /> nAsc := BIN2W<span style=\"color: #000000;\">(</span> cWide <span style=\"color: #000000;\">)</span><br /> ? nAsc<br /> ? <span style=\"color: #ff0000;\">\"Proof\"</span>, HB_UTF8CHR<span style=\"color: #000000;\">(</span> nAsc <span style=\"color: #000000;\">)</span><br /><br /><span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">nil</span><br /> </div>[/code:jekzyezc]",
"time": "12:53",
"topic": "AscW() function",
"username": "nageswaragunupudi"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "So, what about HB_UTF8ASC()? Do we need it?\n\nEMG",
"time": "12:54",
"topic": "AscW() function",
"username": "Enrico Maria Giordano"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "[quote=\"Enrico Maria Giordano\":32ivdfk6]So, what about HB_UTF8ASC()? Do we need it?\n\nEMG[/quote:32ivdfk6]\n\nWe need it.\n\nThis may not be what Mr. Natter is looking for but we need it in xHarbour.\nHarbour has both HB_UTF8CHR() and HB_UTF8ASC().\nBut xHarbour has only HB_UTF8CHR() but not HB_UTF8ASC().\nAddition of this function to xHarbour will be useful.",
"time": "13:22",
"topic": "AscW() function",
"username": "nageswaragunupudi"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Done. Please try xHarbour build 10253.\n\nEMG",
"time": "21:59",
"topic": "AscW() function",
"username": "Enrico Maria Giordano"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "Thank you.\n\nFWH is now using HB_UTF8CHR(). There is no problem either with Harbour or xHarbour.\nTill now there is no need to use HB_UTF8ASC().\nBut, if and when the need arises, what shall we do? There will be many users of older versions of xHarbour. Looks like we need to force them to upgrade xHarbour.\n\nBut what about xharbour.com users? They will get unresolved externals issue.",
"time": "22:01",
"topic": "AscW() function",
"username": "nageswaragunupudi"
}
] |
AscW() function
|
[
{
"date": "2019-06-13",
"forum": "FiveWin for Harbour/xHarbour",
"text": "They can use this code:\n\n[code=fw:3rsshez9]<div class=\"fw\" id=\"{CB}\" style=\"font-family: monospace;\"><span style=\"color: #00D7D7;\">#pragma</span> BEGINDUMP<br /><br /><br /><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"error.ch\"</span><br /><span style=\"color: #00D7D7;\">#include</span> <span style=\"color: #ff0000;\">\"hbapierr.h\"</span><br /><br /><br /><span style=\"color: #00C800;\">static</span> BOOL utf8tou16nextchar<span style=\"color: #000000;\">(</span> UCHAR ucChar, int * n, USHORT * uc <span style=\"color: #000000;\">)</span><br /><span style=\"color: #000000;\">{</span><br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> *n > <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">(</span> ucChar & 0xc0 <span style=\"color: #000000;\">)</span> != 0x80 <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">FALSE</span>;<br /> *uc = <span style=\"color: #000000;\">(</span> *uc << <span style=\"color: #000000;\">6</span> <span style=\"color: #000000;\">)</span> | <span style=\"color: #000000;\">(</span> ucChar & 0x3f <span style=\"color: #000000;\">)</span>;<br /> <span style=\"color: #000000;\">(</span> *n <span style=\"color: #000000;\">)</span>--;<br /> <span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">TRUE</span>;<br /> <span style=\"color: #000000;\">}</span><br /><br /> *n = <span style=\"color: #000000;\">0</span>;<br /> *uc = ucChar;<br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ucChar >= 0xc0 <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ucChar < 0xe0 <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> *uc &= 0x1f;<br /> *n = <span style=\"color: #000000;\">1</span>;<br /> <span style=\"color: #000000;\">}</span><br /> <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ucChar < 0xf0 <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> *uc &= 0x0f;<br /> *n = <span style=\"color: #000000;\">2</span>;<br /> <span style=\"color: #000000;\">}</span><br /> <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ucChar < 0xf8 <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> *uc &= 0x07;<br /> *n = <span style=\"color: #000000;\">3</span>;<br /> <span style=\"color: #000000;\">}</span><br /> <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ucChar < 0xfc <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> *uc &= 0x03;<br /> *n = <span style=\"color: #000000;\">4</span>;<br /> <span style=\"color: #000000;\">}</span><br /> <span style=\"color: #00C800;\">else</span> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ucChar < 0xfe <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> *uc &= 0x01;<br /> *n = <span style=\"color: #000000;\">5</span>;<br /> <span style=\"color: #000000;\">}</span><br /> <span style=\"color: #000000;\">}</span><br /> <span style=\"color: #00C800;\">return</span> <span style=\"color: #00C800;\">TRUE</span>;<br /><span style=\"color: #000000;\">}</span><br /><br /><br /><span style=\"color: #00C800;\">HB_FUNC</span><span style=\"color: #000000;\">(</span> HB_UTF8ASC <span style=\"color: #000000;\">)</span><br /><span style=\"color: #000000;\">{</span><br /> const char * pszString = hb_parc<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">)</span>;<br /><br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> pszString <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> HB_SIZE nLen = hb_parclen<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">1</span> <span style=\"color: #000000;\">)</span>;<br /> USHORT wc = <span style=\"color: #000000;\">0</span>;<br /> int n = <span style=\"color: #000000;\">0</span>;<br /><br /> <span style=\"color: #00C800;\">while</span><span style=\"color: #000000;\">(</span> nLen <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #000000;\">{</span><br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> ! utf8tou16nextchar<span style=\"color: #000000;\">(</span> <span style=\"color: #000000;\">(</span> unsigned char <span style=\"color: #000000;\">)</span> *pszString, &n, &wc <span style=\"color: #000000;\">)</span> <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #00C800;\">break</span>;<br /><br /> <span style=\"color: #00C800;\">if</span><span style=\"color: #000000;\">(</span> n == <span style=\"color: #000000;\">0</span> <span style=\"color: #000000;\">)</span><br /> <span style=\"color: #00C800;\">break</span>;<br /><br /> pszString++;<br /><br /> nLen--;<br /> <span style=\"color: #000000;\">}</span><br /><br /> hb_retnint<span style=\"color: #000000;\">(</span> wc <span style=\"color: #000000;\">)</span>;<br /> <span style=\"color: #000000;\">}</span><br /> <span style=\"color: #00C800;\">else</span><br /> hb_errRT_BASE_SubstR<span style=\"color: #000000;\">(</span> EG_ARG, <span style=\"color: #000000;\">3012</span>, <span style=\"color: #00C800;\">NULL</span>, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS <span style=\"color: #000000;\">)</span>;<br /><span style=\"color: #000000;\">}</span><br /><br /><span style=\"color: #00D7D7;\">#pragma</span> ENDDUMP</div>[/code:3rsshez9]\n\nEMG",
"time": "22:22",
"topic": "AscW() function",
"username": "Enrico Maria Giordano"
}
] |
AscW() function
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.