Re: External data storage question

2017-08-04 Thread John Baughman via 4D_Tech

On Aug 4, 2017, at 1:25 PM, Timothy Penner via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

> For this specific issue, I wonder if the behavior is mentioned in the 
> references to "custom mode" in the 'External Data Storage' documentation here;
> http://livedoc.4d.com/4Dv15.4/help/Title/en/page3202.html 
> 
This behavior is not mentioned nor is there any discussion of how the data is 
cached. I read the blurb in the design ref while I was trying to debug the 
problem and again just now.

I stil think this might be a bug or at least unintended behavior (isn’t that 
the definition of a bug?). The documentation for Set External Data Path 
explicitly states that the command does not need to be reissued unless the path 
changes... “4D automatically maintains the link between the field of the record 
and the file on disk.”

I went ahead and added the following comment to livedoc. FYI, When you save the 
comment it says that the comment will be sent to the doc team after validation. 

> 
> While the docs say that once this command is executed you do not need to 
> execute the command again unless you update the path, if you modify the field 
> you must in fact issue this command again. Otherwise accessing the field 
> during  the current session will continue to return the original version of 
> the field, the version when it was first loaded, even though the file on disk 
> has been updated.
> 
> It appears that the field is being cached when first loaded and the cache is 
> not being updated when the field is modified and saved. 
> 
> Set External Data Path appears to be refreshing the cache with the newly 
> saved version of the field on disk even when the path has not changed.

John

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: External data storage question

2017-08-06 Thread John Baughman via 4D_Tech
Thought I had this resolved, but just discovered this not to be the case 
running Client/Server.

Apparently calling SET EXTERNAL DATA PATH and/or RELOAD EXTERNAL DATA in the 
trigger has no affect on the client. The client continues to reflect the 
version of the picture it loaded before replacing the picture in the field.

Even worse, if I quit and restart the client it continues to reflect the 
original, even if I log in as a different user. Quit and restart the server, 
however, and all is well. So, assuming this is a cache issue, in client Server 
the cache is on the server.

This is such a major bug, I think I must be doing something wrong. I created a 
small v16.1 test db to give to 4D TS. I am going to list below the steps to 
reproduce the problem in the test database in hopes that someone can point out 
the error in my way.

I sm currently at a loss as to how to force the client to forget the original 
image. 

Neither SET EXTERNAL DATA PATH or RELOAD EXTERNAL DATA can be run on the 
client. Everything has to be done on the server. The docs for RELOAD EXTERNAL 
DATA  say that on client one must reload the record "using the LOAD RECORD 
command for example”. This does not work. A record is reloaded in the normal 
process of going from the output form to the input form and moving between 
records in the output form before going to an input form. Just to be sure I 
unloaded and loaded the record manually and it made no difference. 

Keep in mind that the docs say that RELOAD EXTERNAL DATA is useful for  when a 
file in the external data storage folder is modified by a 3rd party app outside 
of 4D. It goes to imply that you only need to do that if the image is being 
displayed in a form.

Hoping someone can point out what I am doing wrong before Monday.

Thanks,

John

---
1. In the output form of the table double click a record which already has a 
picture in 4D and stored outside the database in a custom external data folder. 
Note: There is no problem creating new records. Only when the image is 
changed in an existing record.

2. In the input form load a different picture...

$doc=Select Document(…)
$path:=...
READ PICTURE FILE($path;[Patient Record]Image)

At this point I can see the newly uploaded image is being displayed in 
the field on the input form. 

3. Save the record. Trigger runs…

$imagePath;=… full path to the file in the external data folder
WRITE PICTURE FILE($imagePath;[Patient Record]Image)
SET EXTERNAL DATA PATH([Patient Record]Image;$imagePath) //not really 
necessary as the path did not change but this fixed the problem in stand alone
RELOAD EXTERNAL DATA([Patient Record]Image)  //this is the bigger 
hammer 

At this point I can visually verify that the file in the external data 
folder has changed. So the server does in fact get the updated picture in the 
picture field.

4. Open the record again and see that the original image is still displayed not 
the one that was just saved.

If the record is saved again now as is, the picture in the external 
data folder on the server will revert back to the original picture as step 3 
repeats with the original image.
If you poke the image programmatically, with Picture Size for example, 
the results will be for the original picture not the update.
-





 
> On Aug 3, 2017, at 1:21 PM, John Baughman via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I recently changed storing a picture field outside the database from 
> automatic location to custom path name to file. Still working on getting it 
> ready for deployment.
> 
> I just noticed that if I open a form with the picture field displayed, then 
> change the picture to a different image, save it, then reopen the record, the 
> picture field continues to display the old picture. The picture file in the 
> storage folder reflects the new picture. I can actually watch it change as 
> the record is saved. The bad thing is if I save the record again the old 
> picture gets saved to the storage folder and the new picture is lost. If I 
> restart the database, without having reentered and saved again, the new 
> picture displays properly.
> 
> I know that I have to manage the creation and modification of the picture on 
> disk which I am doing, but I do not see anything that says I have to load the 
> picture from the storage folder. Am I missing something?
> 
> I also recently started working this db in v16 R4 beta so this may be a bug 
> in the beta? I do not really have an easy way to test this is an earlier 
> version of 4D.
> 
> John
> 
> 
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com
> 
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)

Re: Preventing Duplicate Data WAS UUID vs Longint primary key

2017-08-07 Thread John Baughman via 4D_Tech
What I have done is to have a field in the table  that contains the keys that 
make the record unique with all spaces, special characters, and vowels removed, 
as well as eliminating any consecutive consonants . See my example below. So 
far this has worked pretty well for me and I guess would fall under David’s 
category of "Carefully program your system to detect and prevent duplicate rows”

John

—— Example 
$firstName:=[Contacts]firstName (John)
$lastName:=[Contacts]lastName (Baughman)
$company:=[Contacts]company (BY’te DESIGN Hawwaii)  notice I have mistakenly 
put more than 1 w in Hawaii.
$DupeCheck:= $firstName+ $lastName+$company
[Contacts]DupeCheck:=AlphaOnlyNoVowels ($DupeCheck;"*”)  //AlphaOnlyNoVowels 
does the heavy lifting. The asterisk tells the method to remove consecutive 
consonants.

[Contacts]DupeCheck now contains  “JHNBGHMNBYTDSGNHW”

I wrap the above in a duplicate checking method for the [Contacts] table called 
ContactsDuplicateManager

Whenever a record is updated or created in the Contacts table…

$DupeCheck:= ContactsDuplicateManager ("isDuplcate”;[Contacts]ID)

The ContactsDuplicate method creates the check string as above and searches the 
contacts table for duplicates using the [Contacts]DupeCheck field. If no 
duplicates are found it returns the check string. If a duplicate is found it 
returns the check string with a prepended asterisk.  The contact ID if passed 
prevents the dupe check from finding the record being updated. If this is a new 
record 0 is passed for the Contact ID. So…

If ($DupeCheck =“*@“
   Handle the duplicate in context. If, for example this is a user updating or 
creating a contact record, warn the user of the possible duplicate with 
available options.

else
   [Contacts]DupeCheck:=$DupeCheck
   SAVE RECORD([Contacts)
  
end if

-





> On Aug 7, 2017, at 6:56 AM, Dennis, Neil via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
>> How do you deal with that problem (Preventing duplicate data)
> 
> When unique data is required because of a business need, I do implement one 
> of your suggested methods: "Carefully program your system to detect and 
> prevent duplicate rows."
> 
> I would suggest not doing this in a trigger, but instead on data entry 
> (imports, user entry). The 4D command "Find in Field" works in many of these 
> cases.
> 
> Neil
> 
> 
> 
> 
> --
> 
> 
> Privacy Disclaimer: This message contains confidential information and is 
> intended only for the named addressee. If you are not the named addressee you 
> should not disseminate, distribute or copy this email. Please delete this 
> email from your system and notify the sender immediately by replying to this 
> email.  If you are not the intended recipient you are notified that 
> disclosing, copying, distributing or taking any action in reliance on the 
> contents of this information is strictly prohibited.
> 
> The Alternative Investments division of UMB Fund Services provides a full 
> range of services to hedge funds, funds of funds and private equity funds.  
> Any tax advice in this communication is not intended to be used, and cannot 
> be used, by a client or any other person or entity for the purpose of (a) 
> avoiding penalties that may be imposed on any taxpayer or (b) promoting, 
> marketing, or recommending to another party any matter addressed herein.
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Using c_object for passing parameters

2017-08-09 Thread John Baughman via 4D_Tech
I started using the c_object just recently and am finding more and more places 
to adapt it’s use. I thought my latest revelation was interesting, at least to 
me. I was creating a process that involves several levels of user interaction. 
In other words the user is presented with a list with options that create a 
different list with options that create a different list, etc. All when 
completed returning back to the previous list.

I like to use local variables as much as possible and I soon found myself 
creating too many local variables like $button, $button2, $button3, etc. I was 
also stepping on local variables  too often when I forgot to create a unique 
variable for the list being displayed. At first blush I was going to just push 
each list off to it’s own method. I hate doing this as too many methods in a 
unique process just gets too messy.

Then it dawned on me to use c_object for the parameters and keep all the lists 
in the same method. To me and my simple mind I thought this was pretty cool, 
perhaps someone else might find the thought process interesting or even useful 
so I have pasted a code snippet below….

John


//Initial call from another method…
C_OBJECT($oParams)
$oParams:=New object("action";"DoProcedures";"date";$aDate{Size of 
array($aDate)}) //plus other paams...
AptLenghtMigrate_Procedures ($oParams)

--
// *** Method: AptLenghtMigrate_Procedures ***
C_OBJECT($oParams)
ARRAY LONGINT($aProcedureSeq;0)  //need this because the array will be put in a 
c_object later
ARRAY LONGINT($aProcedureMIgrationLength;0)  //need this because the array will 
be put in a c_object later

$oParams:=$1
$action:=$oParams.action
$startDate:=Date($oParams.date)

Case of 
   : ($action="DoProcedures")
ALL RECORDS([Procedure])
SELECTION TO 
ARRAY([Procedure]_Procedure_Sequence;$aProcedureSeq;[Procedure]Migration_Procedure_Length;$aProcedureMIgrationLength)
 //plus more arrays…

Repeat 
//Display the procedures to the user and provide options
   Case of 
 : ($button=4) //user selected option 4 to list appointments 
scheduled after $startDate
OB SET 
ARRAY($oParams;"procedure_sequences";$aProcedureSeq)
OB SET 
ARRAY($oParams;"procedure_m_lengths";$aProcedureMIgrationLength)
$oParams.action:="ListAppointments"
AptLenghtMigrate_Procedures ($oParams)
  End case 
 Until ($Button=1)

  : ($action="ListAppointments")
QUERY([Appointment];[Appointment]Appointment_Date>=$startDate)
SELECTION TO 
ARRAY([Appointment]Appointment_Date;$aAppointmentDate;[Appointment]_Chair_Sequence;$aChairSequence)
  //plus more arrays... 

Repeat 
 //Display the scheduled appointments to the user and provide 
options

 If ($Button=1) //user selected option 1 to list appointments 
scheduled on a selected date and chair with procedure lengths
   $oParams.chair_date:=$aAppointmentDate{$line}
   $oParams.chair_sequence:=$aChairSequence{$line}
  $oParams.action:="ListChairAppointments"
  AptLenghtMigrate_Procedures ($oParams)

 End if 

  Until ($done)

   : ($action="ListChairAppointments")
  OB GET ARRAY($oParams;"procedure_sequences";$aProcedureSeq)
  OB GET 
ARRAY($oParams;"procedure_m_lengths";$aProcedureMIgrationLength)
  //will use the 2 arrays created in the initial call to get migration 
lengths for each scheduled procedure

  
QUERY([Appointment];[Appointment]Appointment_Date=Date($oParams.chair_date);*)
  QUERY([Appointment]; & 
;[Appointment]_Chair_Sequence=$oParams.chair_sequence)
  SELECTION TO ARRAY(….

  Repeat 
   //Display the chair appointments to the user and provide options
   Case of 
  : ($Button=3)  //etc...
   End case 
  Until ($Done)

:($action=“etc….")
   //etc…

:($action=“etc….")
   //etc…

End case 



John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Anybody using the TimePicker widget - TimePicker SET STEP

2017-08-09 Thread John Baughman via 4D_Tech
I have been using this for a very long time and always with a 45 min step. Now 
I need to set it to a 10 min step Y calling..

TimePicker SET STEP ($ObjectName;?00:10:00?)

Nothing happens. It stays at 45 mins.

Any ideas?

John



John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Anybody using the TimePicker widget - TimePicker SET STEP

2017-08-10 Thread John Baughman via 4D_Tech
OK. I figured it out. The sample code in the picker method calls TimePicker SET 
STEP in the On Load form event. That does not work. Apparently it has to be 
called after the form is loaded. So I set a timer and am call all the setup 
commands in the On Timer event. Works now. 

Also if you are passing a default value, be sure to assign it to the picker 
after you have set the step or it will be handled with the default step and 
might get rounded to fit the step.

BTW, I had a typo in my original message. 45 mins is not a valid step for the 
picker. It should have red 15 mins.

John


> On Aug 9, 2017, at 3:14 PM, John Baughman via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I have been using this for a very long time and always with a 45 min step. 
> Now I need to set it to a 10 min step Y calling..
> 
>   TimePicker SET STEP ($ObjectName;?00:10:00?)
> 
> Nothing happens. It stays at 45 mins.
> 
> Any ideas?
> 
> John
> 
> 
>   
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com
> 
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Anybody using the TimePicker widget - TimePicker SET STEP

2017-08-10 Thread John Baughman via 4D_Tech

> On Aug 10, 2017, at 11:17 AM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> and the widget must be used on page 0 or 1.

Ah Ha! That was the problem. My widget is on page 2. In any event works in an 
on timer event.

John



John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Anybody using the TimePicker widget - TimePicker SET STEP

2017-08-10 Thread John Baughman via 4D_Tech
Is the page one requirement documented anywhere. Looked and could not find it. 

If not, perhaps it should be.

John


> On Aug 10, 2017, at 12:01 PM, John Baughman  wrote:
> 
> 
>> On Aug 10, 2017, at 11:17 AM, Keisuke Miyako via 4D_Tech 
>> <4d_tech@lists.4d.com > wrote:
>> 
>> and the widget must be used on page 0 or 1.
> 
> Ah Ha! That was the problem. My widget is on page 2. In any event works in an 
> on timer event.
> 
> John
> 
> 
> 
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com 
> 
> 
> 
> 
> 

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

livedoc 4D v16 R5??

2017-08-10 Thread John Baughman via 4D_Tech
Just on the livedoc site and noticed a new tab… 4D v16 R5

Nothing in the tab, but the next tab over is 4D v16 R4 BETA. H what's up 
with that? Probably just a transient thing and likely a mistake, but 
interesting.

John


John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Batch file and 4DLink file on windows 2008 server

2017-08-17 Thread John Baughman via 4D_Tech
I have a batch file for 4D server working to start 4D Server when the machine 
starts up.

I am trying to create a batch file for 4D client, but cannot get the client to 
open the remote database. This is for a client on the same machine as the 
server. The batch file looks like this…

START "" "C:\Program Files (x86)\4D\4D v16.1\4D\4D.exe" 
"C:\Users\Administrator\AppData\Roaming\4D\Favorites v16\Remote\QDGDocs.4Dlink”

The client opens but does not connect to the server. I copied the path to the 
4DLink file so I am certain that it is correct, and this is the only 4DLink 
file on the computer besudes the one for the server. The 4DLInk file looks like 
this…

mailto:john...@hawaii.rr.com>





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

OB Copy, New Object, or $1

2017-09-02 Thread John Baughman via 4D_Tech
In order to use dot notation a c_object must have been initialized. So when 
passing a c_object as a parameter to a method you cannot use dot notation on 
the object as you might normally do with any other kind of parameter. This will 
not work...

C_Object($myCoolObject;$1)
$myCoolObject:=$1
If($myCoolObject.action=“Startup”)  // this will generate a syntax 
error.
End If

So we have several options…
C_Object($1)
If($1=“Startup”)
End If
Or
c_Object($myCoolObject;$1)
New object(myCoolObject)
$myCoolObject:=$1
If($myCoolObject.action=“Startup”)  
End If
Or
C_Object($myCoolObject;$1)
$myCoolObject:=OB Copy($1)
If($myCoolObject.action=“Startup”)
End If

Is any one of these options better than the other? I am guessing not. Since I 
like to always have readable vars, $1 means nothing, I have opted to use OB 
Copy as it is the simplest form and closest to myCoolObject:=$1.

Any other way to do this?

John


John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: OB Copy, New Object, or $1

2017-09-02 Thread John Baughman via 4D_Tech

> On Sep 2, 2017, at 11:50 AM, Douglas von Roeder via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> When I use C_Object, it's
> 
> C_Object($O_;$1)
> $O_:=$1


Unless you are using the OBJ Module component, this syntax would not allow dot 
notation. Now that R4 beta includes dot notation natively, I prefer to use the 
native code and so I ask the question.

John



John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: OB Copy, New Object, or $1

2017-09-03 Thread John Baughman via 4D_Tech
I just went back and tested the same code I started this thread with and found 
that $oCallerObject:=$1 works. Not sure why it did not work before. I am 
certain that the action property existed as by just replacing  
$oCallerObject:=$1 with $oCallerObject:=OB Copy($1) it would work. Also I spent 
a great deal of time looking at the object in the debugger and after  
$oCallerObject always remained undefined. Not anymore !!??!!

Sorry for the wild goos chase. 

John


> On Sep 3, 2017, at 7:04 AM, Jeremy French  wrote:
> 
> Have you looked at “$myCoolObject" in the Debugger? Does a property named 
> "action" exist?

> I just tried passing an object argument. The assignment in your line below 
> works, provided the object passed actually exists (i.e., is at a minimum an 
> empty object "{}"):
> 
> --
> C_Object($myCoolObject;$1)
> $myCoolObject:=$1
> --

Not sure why you are getting different results…


John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Quickbooks 2014/4D 2014/QB SDK 13.0

2017-09-05 Thread John Baughman via 4D_Tech
I have a v14 database deployed that talks to Quickbooks desktop on Windows 7. I 
can’t remember now if I ever posted to the NUM how I ended up doing it. I 
haven’t touched the code for over a year so could not tell you in detail how it 
all works now.

If you read the SDK you will see that there ar several ways to connect to 
QuciBooks. I used qbXML Request as opposed to the QBFC method. Read the QBSDK 
Programmers Guide to see the difference.

You have to install the QBXMLRP2Lib COMM object, links are provided in the SDK 
for the installers. You send requests and receive data via the COMM object. 
Using the COMM object was the most difficult part, which I got to work using 
PowerShell which I believe is installed by default in Windows 7. 

Basically you create the request XML, wrap it in a PowerShell script and save 
it to disk as a PowerShell script file, .ps1.  Then execute the script with 
LEP. The return stream (XML) is written to an output file on disk.

You also need to jump through some hoops with the RDS Server and RDS Client if 
QuickBooks is not resident on the same machine sending the requests. Links for 
the RDS components are include with the SDK. I found that where QuickBooks is 
located is not the 4D developers call. It could be anywhere  so there are lots 
of options available...

QB on 4D Server machine…
All 4D Clients <->request<-> 4D Server <->request<-> QB
OR
All 4D Clients <->request<-> RDS Client <->request<-> RDS Server 
<->request<-> QB

QB on 4D Client machine…
Local 4D Client ->request-> QB
Remote 4D Clients <->request<-> RDS Client <->request<-> RDS Server 
<->request<-> QB

  QB on remote machine…
All 4D Clients <->request<-> 4D Server <->request<-> RDS Client 
<->request<-> RDS Server <->request<-> QB
OR
All 4D Clients <->request<-> RDS Client <->request<-> RDS Server 
<->request<-> QB

Bottom line is that this is all doable with native 4D and PowerShell. I am not 
familiar with Oauth1 or Oauth2. Isn’t this for connectivity with QuicikBooks 
online? Not a player for desktop?

Like I said my brain is a bit fuzzy on the details of how this all works, but 
if you get into the thick of it and need some help, contact me offline and I 
can probably figure things our or at least give you some moral support.

John




 
> On Sep 5, 2017, at 1:18 PM, Douglas von Roeder via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Heh folks - where did this end up?
> 
> I'm working with a company that's using QB desktop and, based on the
> initial, brief discussions they want to send data to QB, create invoices,
> and get the invoice number back in 4D.
> 
> What's the best approach to take for that.
> 
> Kirk - at least the API uses XML or JSON (what…no EDI!?). Was that the case
> when you checked into it ("into it" - apologies for the pun).
> 
> 
> 
> --
> Douglas von Roeder
> 949-336-2902
> 
> On Sun, Jan 11, 2015 at 1:51 PM, Kirk Brooks  wrote:
> 
>> No - what could possibly go wrong?
>> 
>> Just kidding. I took a look at this sort of thing a couple of years ago but
>> got sidetracked before doing anything with it. I'm interested in getting 4D
>> to talk with QB Online myself. I've always found the Quickbooks SDK
>> somewhat ponderous to deal with but it might be better now. I would be
>> willing to put some work into such a project if it will help.
>> 
>> BTW - what is QBManager? I don't see any other references here. Is it that
>> plugin (component?) Miles wrote way back when?
>> 
>> 
>> On Fri, Jan 9, 2015 at 6:38 PM, John Baughman 
>> wrote:
>> 
>>> So the plan is to upgrade QuickBooks to 2014(15?), upgrade 4D to 2014,
>> and
>>> rewrite the connectivity code utilizing the QB SDK (13.0) via ODBC.
>>> 
>>> Are there any flaws in my plan
>>> ​?​
>>> 
>>> 
>> --
>> Kirk Brooks
>> San Francisco, CA
>> ===
>> **
>> See how easy it is to extend your 4D solutions to Web and mobile. New
>> opportunities await you with 4D v14!
>> 
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
>> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNU

Re: Quickbooks 2014/4D 2014/QB SDK 13.0

2017-09-07 Thread John Baughman via 4D_Tech
Doug,

I would say that the SDK is only a windows option. I could be wrong, 
but I do not believe that there is a Mac OS option for  talking with QuickBooks 
for Mac desktop.

   Using a VM is absolutely doable. I did all of my development work on a 
mac using Oracle VirtualBox. I do not like Parallels or Fusion. I have found 
VirtualBox to be rock solid. It is free and well supported. To each his own, 
however, any VM should work just fine.

I am assuming that this is a 4D client/server solution. Either the 
server or s 4D client has to be on a windows VM as their would otherwise be no 
way to talk to QB…

   QB and 4D Server on the VM (or anywhere on a windows machine on the 
network using the QB client/server components)…
 All 4D Clients mac or windows <->Execute on Server<-> 4D 
Server <->request<-> QB

   QB and 4D Client on the VM with 4D Server on a Mac
 The one 4D Client on the VM <->request<-> request<-> QB

Actually perhaps you could use a “headless" client on the VM and use 
Execute On Client. This might be an excellent place for a worker process :-)

QB and Headless 4D Client on the VM with 4D Server on a Mac
All 4D Clients mac or windows <->Execute on Client<-> Headless 
4D Client <->request<-> QB 

With this approach you would not have to use a VM. Just put the 
headless client and install the COMM object on her windows laptop.

Lots of possibilities. There is also the QuickBooks Web Connector 
(QBWC) which provides functionality for access to QuickBooks as a web service 
thus eliminating the need for dealing with the COMM object. I did not go this 
route so know very little about how this works, but it’s all in the SDK.

BTW, I have a couple of methods that might help you better understand 
how I did the 4D side…

QB_GetCompany - Creates the XML request. I use this to test the 
connection to QB. I also modify a duplicate of this method to create a method 
for each type of request required by my clients.
QB_CreatePowerShellSctipt - Wraps a PowerShell script call to 
the COMM object around the xml request script.
QB_PS_ExecuteScript - Executes the PowerShell script with LEP.

A lot of it may not make sense until you have studied the SDK. I will 
send these methods to you directly. If anyone else is interested, please feel 
free to contact me directly.

John





> On Sep 7, 2017, at 2:15 PM, Douglas von Roeder via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> John:
> 
> Just getting back to this…
> 
> Got a hitch in the git along - all the computers running 4D are on OS X.
> Their accountant is using a Mac for most of her work but she has a Windows
> laptop for QB. From a recent conversation, they're open to moving her to a
> MacBook + Parallels for QB.
> 
> Since PowerShell = Windows, is it correct that she'd have to run 4D on
> Windows to use this approach?
> 
> 
> --
> Douglas von Roeder
> 949-336-2902
> 
> On Tue, Sep 5, 2017 at 8:55 PM, John Baughman via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> I have a v14 database deployed that talks to Quickbooks desktop on Windows
>> 7. I can’t remember now if I ever posted to the NUM how I ended up doing
>> it. I haven’t touched the code for over a year so could not tell you in
>> detail how it all works now.
>> 
>> If you read the SDK you will see that there ar several ways to connect to
>> QuciBooks. I used qbXML Request as opposed to the QBFC method. Read the
>> QBSDK Programmers Guide to see the difference.
>> 
>> You have to install the QBXMLRP2Lib COMM object, links are provided in the
>> SDK for the installers. You send requests and receive data via the COMM
>> object. Using the COMM object was the most difficult part, which I got to
>> work using PowerShell which I believe is installed by default in Windows 7.
>> 
>> Basically you create the request XML, wrap it in a PowerShell script and
>> save it to disk as a PowerShell script file, .ps1.  Then execute the script
>> with LEP. The return stream (XML) is written to an output file on disk.
>> 
>> You also need to jump through some hoops with the RDS Server and RDS
>> Client if QuickBooks is not resident on the same machine sending the
>> requests. Links for the RDS components are include with the SDK. I found
>> that where QuickBooks is located is not the 4D developers call. It could be
>> anywhere  so there are lots of options available...
>> 
>>QB on 4D Server machine…
>>All 4D Clients <->request<-> 4D Server <->request<-> QB
>>

Re: Object fields (Was: Re: QUERY BY ATTRIBUTE is slow af)

2017-09-13 Thread John Baughman via 4D_Tech
In my mind a variable is the same thing as a key value pair. The variable name 
is the key and the data the variable contains is the value. I name all 
variables with a user readable name so what is the difference between a 
variable named vFirstName that contains “John” and oObj.firstname that equals 
“John”.  

If (vFirstName=“John”)   0rIf (oObj.firstname =“John”)

In this vein, I am looking at any blob field that contains an ObjectTools 
object, as a potential candidate for replacement with a c_object field. I say 
looking at, as I am not sure it is worth the effort to replace existing code 
unless I decide to drop the use of the OT plugin.

I am thinking going forward, however, that in a process where I know I need to 
store “state” for revisits, I can use an object field instead of a blob field 
with OT object. Hey, instead of using variables at all,  why not use a c_object 
from the get go. With dot notation it becomes really easy to work with the 
c_object just like you would a variable. Store the c_object in the database 
when the process closes and retrieve it when the process is revisited.

John




> On Sep 12, 2017, at 9:27 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
>> Here´s my real-world use:
>> I wrote an iPhone app that collects data (scans barcodes).
>> That data is in JSON format and transferred via HTTP to a 4D Server.
>> The server stores that data in an object field (which is never queried. It
>> just holds the collected data).
> 
> That's a great example of a classic use for a JSON field, by whatever name.
> (And one of the reasons I would like compression options for JSON fields in
> 4D.) This an example that I'd file under "storing logging or API result
> data", something that makes sense to me for a doc field, if you need the
> data in the database for some reason.
> 
> By default, I don't want most logging data in 4D, but do when it's for
> auditing/troubleshooting. I like text files pushed into a log analyzer. I
> should be working on that again shortly, actually.
> 
>> The same would work with a text- or blob-field to store the data, but an
>> object field makes it a bit easier.
> 
> Great example, thanks for sharing.
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: read from a MS SQL server with 4D

2017-09-13 Thread John Baughman via 4D_Tech
I have not done anything in 4D with MS SQL Server, but have done quite a bit of 
scripting using SQL Server Management Studio (SQLSMS). 

It is very easy to work with SQLSMS and I taught myself how to write the 
scripts by copying example scripts from the internet and running them in 
SQLSMS, modifying the examples, then finally writing my own scripts. I found 
this to be an excellent learning environment.

If I were to have to write any SQL code in 4D, I think I would write the code 
in SQLSMS and test it there first. Then copy the code into 4D. 

If you do not have access to the actual SQL Server you will be accessing, set 
yourself up with a sql server in your development environment and install a 
demo data base to work with…


http://www.faceofit.com/direct-links-to-download-sql-server-sample-databases/

When I first started, I used the Adventure Works demo database in a VM on my 
Mac. After I felt comfortable with what I was doing I moved to the actual MS 
SQL database and work on it directly now.

Hope that helps,

John



> On Sep 13, 2017, at 5:49 AM, Randy Engle via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Ferdinando,
> 
> W3 Schools is a good source of examples:
> 
> https://www.w3schools.com/sql/
> 
> 
> Randy Engle, Director
> XC2 Software LLC – XC2LIVE!
> 
> -Original Message-
> From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of 
> stardata.info via 4D_Tech
> Sent: Wednesday, September 13, 2017 5:28 AM
> To: 4d_tech@lists.4d.com
> Cc: stardata.info 
> Subject: read from a MS SQL server with 4D
> 
> I all,
> 
> I need to read from a MS SQL server with 4D.
> Someone can give a link with examples.
> 
> Thanks
> /Ferdinando/
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Converting pictures

2018-12-28 Thread JOHN BAUGHMAN via 4D_Tech
What I did was cut each picture off the form to the pasteboard run the 
following code then paste it back into the form…

C_PICTURE($picture_c)
GET PICTURE FROM PASTEBOARD($picture_c)
  // convert the picture
CONVERT PICTURE($picture_c;".png")

  // make all white pixels transparent
TRANSFORM PICTURE($picture_c;Transparency;0x00FF)

SET PICTURE TO PASTEBOARD($picture_c)

Perhaps the is a way to automate this but just did it manually.

John




> On Dec 28, 2018, at 9:32 AM, Alan Tilson via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hello everyone,
> 
> Is there code that can convert static PICT images to PNG, images not in a
> library?
> 
> Thanks,
> Alan
> 
> On Tue, Oct 23, 2018 at 4:17 PM Timothy Penner via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Hi Setar,
>> 
>> The v13 code to convert PICT -> PNG is here:
>> http://kb.4d.com/assetid=76775
>> ^ There is no transparency option in that code.
>> 
>> While the following code was published for v16:
>> http://kb.4d.com/assetid=77963
>> ^ This one uses the transparency option.
>> 
>> Regarding 4D Pack, it should exist in v16 but it is no longer available in
>> newer versions:
>> http://livedoc.4d.com/4Dv17/help/Title/en/page3607.html#3188011
>> {
>> Over the course of different versions, the most useful 4D Pack routines
>> were progressively integrated into 4D itself, while those that became
>> obsolete were removed. Starting with 4D v16 R2, the 4D Pack plug-in is no
>> longer provided in versions of 4D. Refer to the table below to find out the
>> replacement solutions available (if any) for 4D Pack routines.
>> }
>> 
>> -Tim
>> 
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Replacement Code for very old DisplayList plugin

2019-01-06 Thread JOHN BAUGHMAN via 4D_Tech
Tony Ringsmuth, http://bbsp.com, has an excellent component called 
DisplayList4D ($99.00 if you like it).

John


John Baughman
1331 Auwaiku Street
Kailua, Hawaii  96734
(808) 262-0328
john...@hawaii.rr.com

> On Jan 6, 2019, at 1:05 PM, Walt Nelson via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Folks,
> 
> I recently inherited a VERY, VERY old database that uses the DisplayList 
> plugin. They need this updated to run in 4D v16.
> 
> Before reinvented the wheel…
> 
> I was wondering if anyone has written a component/set of code that replaces 
> the functionality of DisplayList (this is a volunteer effort - therefore, 
> they can’t afford a new AreaList license - I see that DisplayList has been 
> rolled into AreaList now).
> 
> All they need is the ability to select from a dialog with 3 arrays in it and 
> return the multiple rows that were selected by the user in a returning array.
> 
> Foundation Shell has the command Fnd_List_ChoiceList which would be perfect, 
> but it was designed only for a single row selection.
> 
> I need the option of multiple row selection from the old DisplayList.
> 
> Thanks,
> Walt
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Replacement Code for very old DisplayList plugin

2019-01-07 Thread JOHN BAUGHMAN via 4D_Tech
If you want the easiest path to replace the DisplayList plugin I would highly 
recommend Tony’s DisplayList4D. 

ALL of the Displaylist plugin commands are replicated in the component. For 
example SetListHeaders becomes DL_SetlistHeaders, SetListButtons becomes 
DL_SetListButtons, etc. So it is really easy to do a global find and replace.

 I think the majority of the component commands and functions work exactly as 
they did in the plugin so require nothing more to be done. So your 
multi-selection requirement works exactly as it does in the plugin..

There are, however, several that work a bit differently. For example the 
DisplayList now DL_Displaylist function has an extra parameter to start and the 
arrays are passed as pointers instead of array names, without a 15 army limit. 

There are enhancements as well, more than 1 hidden array for example. I use 
DisplayList in all of my databases, actually cannot live without it. When in 
2014 I could no longer use the DisplayList plugin, I had already let go of 
ArealistPro in favor of native 4D list boxes. So Tony;s component was a 
godsend. It was really quite easy to implement, extremely well written and 
documented. Certainly quicker and easier than any other approach.


John



> On Jan 7, 2019, at 6:41 AM, Philippe Ganter via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> And the AreaList Pro license is 90€, which roughly amounts to the same… and 
> includes hundreds of other features.
> 
> www.e-node.net/alp
> 
> Best regards,
> -- 
> Phil
> 
> 
> 
>> On 7 Jan 2019, at 01:17, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> Tony Ringsmuth, http://bbsp.com, has an excellent component called 
>> DisplayList4D ($99.00 if you like it).
>> 
>> John
>> 
>> 
>> John Baughman
>> 1331 Auwaiku Street
>> Kailua, Hawaii  96734
>> (808) 262-0328
>> john...@hawaii.rr.com
>> 
>>> On Jan 6, 2019, at 1:05 PM, Walt Nelson via 4D_Tech <4d_tech@lists.4d.com> 
>>> wrote:
>>> 
>>> Folks,
>>> 
>>> I recently inherited a VERY, VERY old database that uses the DisplayList 
>>> plugin. They need this updated to run in 4D v16.
>>> 
>>> Before reinvented the wheel…
>>> 
>>> I was wondering if anyone has written a component/set of code that replaces 
>>> the functionality of DisplayList (this is a volunteer effort - therefore, 
>>> they can’t afford a new AreaList license - I see that DisplayList has been 
>>> rolled into AreaList now).
>>> 
>>> All they need is the ability to select from a dialog with 3 arrays in it 
>>> and return the multiple rows that were selected by the user in a returning 
>>> array.
>>> 
>>> Foundation Shell has the command Fnd_List_ChoiceList which would be 
>>> perfect, but it was designed only for a single row selection.
>>> 
>>> I need the option of multiple row selection from the old DisplayList.
>>> 
>>> Thanks,
>>> Walt
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Replacement Code for very old DisplayList plugin

2019-01-07 Thread JOHN BAUGHMAN via 4D_Tech
If AreaListPro is the same price and if it is the same as the old DisplayList 
plugin then that would certainly be the easiest approach. The question for me 
would be whether I prefer to use a component of plugin. For me the component.

> On Jan 7, 2019, at 10:34 AM, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> If you want the easiest path to replace the DisplayList plugin I would highly 
> recommend Tony’s DisplayList4D. 
> 
> ALL of the Displaylist plugin commands are replicated in the component. For 
> example SetListHeaders becomes DL_SetlistHeaders, SetListButtons becomes 
> DL_SetListButtons, etc. So it is really easy to do a global find and replace.
> 
> I think the majority of the component commands and functions work exactly as 
> they did in the plugin so require nothing more to be done. So your 
> multi-selection requirement works exactly as it does in the plugin..
> 
> There are, however, several that work a bit differently. For example the 
> DisplayList now DL_Displaylist function has an extra parameter to start and 
> the arrays are passed as pointers instead of array names, without a 15 army 
> limit. 
> 
> There are enhancements as well, more than 1 hidden array for example. I use 
> DisplayList in all of my databases, actually cannot live without it. When in 
> 2014 I could no longer use the DisplayList plugin, I had already let go of 
> ArealistPro in favor of native 4D list boxes. So Tony;s component was a 
> godsend. It was really quite easy to implement, extremely well written and 
> documented. Certainly quicker and easier than any other approach.
> 
> 
> John
> 
> 
> 
>> On Jan 7, 2019, at 6:41 AM, Philippe Ganter via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> And the AreaList Pro license is 90€, which roughly amounts to the same… and 
>> includes hundreds of other features.
>> 
>> www.e-node.net/alp
>> 
>> Best regards,
>> -- 
>> Phil
>> 
>> 
>> 
>>> On 7 Jan 2019, at 01:17, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> 
>>> wrote:
>>> 
>>> Tony Ringsmuth, http://bbsp.com, has an excellent component called 
>>> DisplayList4D ($99.00 if you like it).
>>> 
>>> John
>>> 
>>> 
>>> John Baughman
>>> 1331 Auwaiku Street
>>> Kailua, Hawaii  96734
>>> (808) 262-0328
>>> john...@hawaii.rr.com
>>> 
>>>> On Jan 6, 2019, at 1:05 PM, Walt Nelson via 4D_Tech <4d_tech@lists.4d.com> 
>>>> wrote:
>>>> 
>>>> Folks,
>>>> 
>>>> I recently inherited a VERY, VERY old database that uses the DisplayList 
>>>> plugin. They need this updated to run in 4D v16.
>>>> 
>>>> Before reinvented the wheel…
>>>> 
>>>> I was wondering if anyone has written a component/set of code that 
>>>> replaces the functionality of DisplayList (this is a volunteer effort - 
>>>> therefore, they can’t afford a new AreaList license - I see that 
>>>> DisplayList has been rolled into AreaList now).
>>>> 
>>>> All they need is the ability to select from a dialog with 3 arrays in it 
>>>> and return the multiple rows that were selected by the user in a returning 
>>>> array.
>>>> 
>>>> Foundation Shell has the command Fnd_List_ChoiceList which would be 
>>>> perfect, but it was designed only for a single row selection.
>>>> 
>>>> I need the option of multiple row selection from the old DisplayList.
>>>> 
>>>> Thanks,
>>>> Walt
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Error code 183(W132)

2019-03-13 Thread JOHN BAUGHMAN via 4D_Tech
One of my deployed 4D server has suddenly started throwing this error (see 
below). When the error is being displayed 4D server is not visible. When the ok 
button is clicked 4D server becomes visible.

A quick google search finds some discussion about this error independent of 4D 
and one provides a link to a utility call (Error 183) repair utility.

Can anyone shed some light on this error and perhaps why it is being thrown by 
this particular 4D server.

Thanks,

John

———
Error code 183(W132)
Cannot create a file when that file already exists

Component: ‘W132'
Task 8336

Error code: 6523(xbox
Cannot create folder
C:\User\Administrator\AppData\Local\Temp\1\4D Server\.
Toolbox
Task 8336
---


John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Error code 183(W132)

2019-03-14 Thread JOHN BAUGHMAN via 4D_Tech
Sorry, forgot…

Windows Server 2008 R2 Enterprise Service Pac 1
V16R6 64bit


> On Mar 14, 2019, at 4:27 AM, Chip Scheide <4d_o...@pghrepository.org> wrote:
> 
> platform and version?
> 
> On Wed, 13 Mar 2019 18:24:57 -1000, JOHN BAUGHMAN via 4D_Tech wrote:
>> One of my deployed 4D server has suddenly started throwing this error 
>> (see below). When the error is being displayed 4D server is not 
>> visible. When the ok button is clicked 4D server becomes visible.
>> 
>> A quick google search finds some discussion about this error 
>> independent of 4D and one provides a link to a utility call (Error 
>> 183) repair utility.
>> 
>> Can anyone shed some light on this error and perhaps why it is being 
>> thrown by this particular 4D server.
>> 
>> Thanks,
>> 
>> John
>> 
>> ———
>> Error code 183(W132)
>> Cannot create a file when that file already exists
>> 
>> Component: ‘W132'
>> Task 8336
>> 
>> Error code: 6523(xbox
>> Cannot create folder
>> C:\User\Administrator\AppData\Local\Temp\1\4D Server\.
>> Toolbox
>> Task 8336
>> ---
>> 
>> 
>> John Baughman
>> Kailua, Hawaii
>> (808) 262-0328
>> john...@hawaii.rr.com
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Managing 4D Server as a service

2019-05-09 Thread JOHN BAUGHMAN via 4D_Tech
I am new to this and am wondering how does one manage a 4D Server running as a 
service. If, for example, the server throws an error there is no way to see the 
error. I guess what I am asking is to confirm that there is no way to see the 
server gui while it is running as a service.

Also, I am not sure what "Allow service to interact with desktop" does. I am 
still confused after reading up on this option.I have it checked as what I have 
read leads me to believe that I need it checked for 4D server to access thins 
like the file system, clibboard, email, etc. 

Maybe someone can help me better understand the ins and out of running 4D 
server as a service.

Thanks,

John




**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Managing 4D Server as a service

2019-05-09 Thread JOHN BAUGHMAN via 4D_Tech
Tim,  thank you for that most informative post. It really helps. I will be 
switching my client's 4D Server to a service later this evening for the first 
time. After reading your post I feel far more confident going forward.

> On May 9, 2019, at 11:25 AM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> When interact with desktop is working you will see a program in the Taskbar 
> with a name like “Interactive Services”. It shows a small window with a 
> button you can click. Click the button and the screen changes and you switch 
> — to the "console user" I think it is called — and you will then see the 4D 
> Server Administration window. Desktop disappears. Then everything looks and 
> works just as expected. Error dialogs are displayed. You can edit Database 
> Settings, backup settings, switch tabs in the Administration window, etc. 


The client is running v16R6 on Windows Server 2008 R2. You pointed me in the 
right direction and it appears in this configuration Interactive Services works 
great. I suspect that the client will continue using Win Server 2008 until they 
are forced to upgrade, but I will be moving them to v17 shortly. Hopefully 
Interactive Services will continue to work with v17.

Thank s again,

John
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Managing 4D Server as a service

2019-05-10 Thread JOHN BAUGHMAN via 4D_Tech
Well, last night I tried to start the service on the client’s production 
machine and I could not get it to work.

After registering the service from 4D server, I tried starting the service from 
the Service Manager and it indicated that it had started up but I was unable to 
establish a connection using a 4D client. On my VM Interactive Services takes a 
while to show up in the task bar after a restart, but it eventually does. On 
the production server, it never makes an appearance. So I have no other way to 
see it the server is running properly. 

I then restarted the computer with the service set to start automatically. 
Again I was unable to establish a connection with 4D Client. I tried both 
manually and automatically a few times without success. Each time I tried to 
start up 4D Server normally and on at least one occasion 4D asked if I wanted 
to open the database in Read Only mode, which tells me the service had opened 
the datafile. On other tries, I was able to open the database normally.

A couple of other things to note.
1. A year or so ago I was investigating the ins and outs of running as 
a service on this same machine and I was able to get everything to work.

2. I have the service 4D’s Application Server listening on port 19816 
as I have another 4D server running a different database on the same box opened 
normally (not as a service) listening on port 19813. It only opens after the 
Admin user logs in. They both work fine together when both are opened normally.

3. The service 4D is also running a web server which respond to 
requests from a Xojo WebApp running on the same machine. Those requests fail 
when 4D Server is supposedly 
running as a service.

5. Finally of note is that when the Xojo WebApp is opened as a Service 
it will not open as it unexpectedly quits on startup. All of this, Xojo and 4D 
Server work just fine on my VM and all worked fine a year ago when I first 
started researching things on the production machine. The folks at Xojo suggest 
that my WebApp may be trying to access a file that the service does not have 
access to. Tonight I will be trying to get the Xojo service to work with no 
file access queries in the WebApps startup events.

I think that the inability to start both the Xojo WebApp and 4D as services is 
related and may be encountering an issue with the OS, which may have different 
updates than my VM. The production machine has been religiously updated by 
windows over the year,, my VM not so much.

Any suggestions?

Thanks,

John

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Managing 4D Server as a service

2019-05-10 Thread JOHN BAUGHMAN via 4D_Tech

> On May 10, 2019, at 3:50 AM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> But be warned that you may still run into an issue with how you “Log on as:” 
> in the “Log on” tab in the Services dialog for 4D Server in the Services 
> window. 4D or Microsoft changed something and I had an issue upgrading from 
> 4D Server v12 to v16 on Windows Server 2012. 
> 
> https://dl.dropboxusercontent.com/s/w6d63gpm5rn5mp7/Services%20Log%20On.PNG 
> 
> Normally you just select the default “Local System account” and it works. But 
> when I  did a v12 to v16 upgrade it would not work. Pat Bensky also recently 
> had this same problem. The solution is to switch to “This account:” and use 
> an administrator account. But — and Pat will tell you this — be careful how 
> you specify the account name. It’s not just something like “timnevels” it may 
> be “\domain\timnevels”. Use the “Browse” button to find the account name and 
> it will put it in a form that works. 


That may be my problem (see my recent post). Will check this out 
tonight.

> Also, you may need to “Run as administrator” the 4D Server.exe to be able to 
> access “Register Current Database as Service” in the File menu of 4D Server. 
> If the item is disabled, you need to run as administrator. 

This was not a problem.

> One last tip, if you can, since this is a new switch from macOS to Windows, 
> and if you have ready access to the server machine, start off by NOT running 
> 4D Server as a Windows Service. Run it as a desktop application. You can do 
> the Services setup and try it out, but Stop the service mark the service as 
> “Manual” when you are done setting it up and testing. 

The server has been running on the production machine not as a service 
without any problems for over a year.

John
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Managing 4D Server as a service

2019-05-10 Thread JOHN BAUGHMAN via 4D_Tech
Got it working. The fix was to use the Admin account in the Log On tab. That 
also fixed the Xojo WebApp. The fix did take until the server machine was 
restarted. I also opened 4D server and database as Administrator before 
restarting the computer.

Looks like Interactive desktop only works with Local System account checked. 
Bummer.

Thanks for all who helped.

John



> On May 10, 2019, at 3:50 AM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> On May 10, 2019, at 8:09 AM, JOHN BAUGHMAN wrote:
> 
>> Tim,  thank you for that most informative post. It really helps. I will be 
>> switching my client's 4D Server to a service later this evening for the 
>> first time. After reading your post I feel far more confident going forward.
>> 
>> The client is running v16R6 on Windows Server 2008 R2. You pointed me in the 
>> right direction and it appears in this configuration Interactive Services 
>> works great. I suspect that the client will continue using Win Server 2008 
>> until they are forced to upgrade, but I will be moving them to v17 shortly. 
>> Hopefully Interactive Services will continue to work with v17.
> 
> Windows Server 2008 R2 fully supported interactive desktop, so no need for 
> Registry entry modifications there. 
> 
> But be warned that you may still run into an issue with how you “Log on as:” 
> in the “Log on” tab in the Services dialog for 4D Server in the Services 
> window. 4D or Microsoft changed something and I had an issue upgrading from 
> 4D Server v12 to v16 on Windows Server 2012. 
> 
> https://dl.dropboxusercontent.com/s/w6d63gpm5rn5mp7/Services%20Log%20On.PNG
> 
> Normally you just select the default “Local System account” and it works. But 
> when I  did a v12 to v16 upgrade it would not work. Pat Bensky also recently 
> had this same problem. The solution is to switch to “This account:” and use 
> an administrator account. But — and Pat will tell you this — be careful how 
> you specify the account name. It’s not just something like “timnevels” it may 
> be “\domain\timnevels”. Use the “Browse” button to find the account name and 
> it will put it in a form that works. 
> 
> Also, you may need to “Run as administrator” the 4D Server.exe to be able to 
> access “Register Current Database as Service” in the File menu of 4D Server. 
> If the item is disabled, you need to run as administrator. 
> 
> One last tip, if you can, since this is a new switch from macOS to Windows, 
> and if you have ready access to the server machine, start off by NOT running 
> 4D Server as a Windows Service. Run it as a desktop application. You can do 
> the Services setup and try it out, but Stop the service mark the service as 
> “Manual” when you are done setting it up and testing. 
> 
> Save running as a Service for a few days. Make sure there are no unexpected 
> issues with this macOS to Windows conversion. It’s much more convenient and 
> removes some variables if you just run 4D Server from the Desktop. You can 
> remote to the server and see what is going on without having do the 
> interactive services switch dance. Once things are running smoothly, then you 
> can switch to running as a Service. Any new problems might then be explained 
> as connected to running the database as a Service and not just “worked fine 
> on a macOS server but on Windows server it doesn’t work, so it’s a Windows 
> server problem”. 
> 
> Sometimes printing — like creating PDFs on the server — can be an issue when 
> running as a Service. 
> 
> Tim
> 
> *
> Tim Nevels
> Innovative Solutions
> 785-749-3444
> timnev...@mac.com
> *
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Error Can't load component "Foundation_560.4DC".

2019-05-20 Thread JOHN BAUGHMAN via 4D_Tech
I am trying to upgrade a v13 database to v17 and am taking it first to v14. I 
am working on a Mac but it is deployed on Windows 10. I have it upgraded on the 
Mac with everything working including the PKUID fields. 

I plan to test each upgrade step in Windows. After moving the v14 upgrade over 
to my  Windows 10 VM I get the following error when opening the database with 
4D Server v14.6 (64bit)…

Error Can't load component "Foundation_560.4DC”. 
Error code: -10510 Can't load component "Foundation_560.4DC". 
component: '4DRT' task -3, name: 'Client Manager’ 
 Error code: 6 Could not find compiled runtime information while 
loading database or component "Foundation_560". component: '4dcm' task -3, 
name: 'Client Manager'

It works fine with the interpreted version of Foundation. I tried building the 
compiled version in windows and still get the error.

I can deploy interpreted, but wondering if why I am getting the error compiled.

Thanks

John



John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D Write Pro: License or privilege error

2019-05-22 Thread JOHN BAUGHMAN via 4D_Tech
Thumbs up for VirtualBox. After using VMWare for few years and then Parallels 
for a few more, I discovered VirtualBox and have never looked back. Unlike the 
other 2, I have virtually (no pun intended) had zero issues to deal with. It 
just woks.

John
 

> On May 22, 2019, at 10:29 AM, John J Foster via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> HI Pat,
> 
> Outside of Parallels past slowness I haven't noticed any of these issues. I 
> do other development in other apps and so far haven’t noticed any issues 
> (famous last words!).
> 
> But thanks for the reminder that there are other options. I might give it a 
> try when I can plan in some time.
> 
> Appreciate,
> John…
> 
> 
>> Maybe try using VirtualBox instead of Parallels ... that's what I use and
>> have not had any issues like that. And it's free :)
>> 
>> PB
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

V17R3 vs PowerShell

2019-05-29 Thread JOHN BAUGHMAN via 4D_Tech
Anyone using PowerShell on Windows 10 out there? Maybe you can help me figure 
this out.

I am upgrading an old v13 database to v17. My ultimate goal is to have 
everything run-in 64bit.

The database talks to QuickBooks on a Windows 10 machine using an XML stream in 
a Powershell script file executed with PowerShell by LEP.

 I have successfully upgraded all of 4D to run successfully 64 bit, but have am 
unable to get v17R3 or R4 64bit client to work successfully with 64bit 
PowerShell…


4DServer Client  PowerShell 
Result
v17R364 32  32  
  OK
v17R3.   64 32  64  
  OK

V17R36464   32  
  OK
V17R36464   64  
   X  

I am pretty sure that the PowerShell script is not being executed because 
QuickBooks is not receiving a call. What changes with 64Bit 4d client that 
could possibly be preventing the PowerShell Script from executing?  

I have posted the applicable code and ps script below.

Thanks,

John 


Here is what the LEP call looks like…

ScriptPath:=$1
$4D_Folder:=Get 4D folder(Active 4D Folder)
$FileID:=String(Milliseconds)+"-"+String(Random)

Case of
 :  (32bit). //pseudo code

$FilePath:="C:\\Windows\\sysWoW64\\WindowsPowerShell\\v1.0\\powershell.exe 
-file \""+$ScriptPath+"\”"

 :  (32bit)

$FilePath:="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe 
-file \""+$ScriptPath+"\""

End Case

$OutputStream:=$3
$ErrorStream:=$4
$XMLOutBlobPtr:=$5
  //set the environmentals and launch the external process
SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
SET ENVIRONMENT VARIABLE("_4D_OPTION_CURRENT_DIRECTORY";$4D_Folder)
  //SET ENVIRONMENT VARIABLE("_4D_OPTION_INPUT_STREAM";"I"+$FileID)
SET ENVIRONMENT VARIABLE("_4D_OPTION_OUTPUT_STREAM";"O"+$FileID)
SET ENVIRONMENT VARIABLE("_4D_OPTION_ERROR_STREAM";"E"+$FileID)
SET ENVIRONMENT VARIABLE("_4D_OPTION_STOP_TOKEN";$FileID)
LAUNCH EXTERNAL PROCESS($FilePath)
—

———
The PowerSrcipt script looks like this…

[String]$requestXML = '





'
$myQBXMLRP = New-Object -com QBXMLRP2.RequestProcessor
$myQBXMLRP.OpenConnection2("qb4D","CCFolioPro",1)
$ticket = $myQBXMLRP.BeginSession("C:\Company Files\Cadinha & Co., 
LLC.QBW",$myQBXMLRP.qbFileOpenDoNotCare)
$myQBXMLRP.ProcessRequest($ticket, $requestXML) > $env:_4D_OPTION_OUTPUT_STREAM
$myQBXMLRP.EndSession($ticket)
$myQBXMLRP.CloseConnection()
"Stop" > $env:_4D_OPTION_STOP_TOKEN

---


John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: V17R3 vs PowerShell

2019-05-29 Thread JOHN BAUGHMAN via 4D_Tech
I ran the PS scrip in the 64bit PowerShell ISE and I am getting the error…

80040154 Class not registered

Googling this tells me that this is the result of 64bit PowerShell balking at 
calling a 32bit COM object. I wonder, however, why when run from a 32 bit 4D 
Client the same script calling the same COM object works with the 64bit version 
of PowerShell. What does 4D have to do with the execution of the PowerShell 
Script? Perhaps LEP functions differently in 64bit than it does in 32bit?

John

> On May 29, 2019, at 7:12 PM, JOHN BAUGHMAN  wrote:
> 
> Anyone using PowerShell on Windows 10 out there? Maybe you can help me figure 
> this out.
> 
> I am upgrading an old v13 database to v17. My ultimate goal is to have 
> everything run-in 64bit.
> 
> The database talks to QuickBooks on a Windows 10 machine using an XML stream 
> in a Powershell script file executed with PowerShell by LEP.
> 
> I have successfully upgraded all of 4D to run successfully 64 bit, but have 
> am unable to get v17R3 or R4 64bit client to work successfully with 64bit 
> PowerShell…
> 
> 
> 4DServer Client  PowerShell   
>   Result
> v17R364 32  32
> OK
> v17R3.   64 32  64
> OK
> 
> V17R36464   32
> OK
> V17R36464   64
>  X  
> 
> I am pretty sure that the PowerShell script is not being executed because 
> QuickBooks is not receiving a call. What changes with 64Bit 4d client that 
> could possibly be preventing the PowerShell Script from executing?  
> 
> I have posted the applicable code and ps script below.
> 
> Thanks,
> 
> John 
> 
> 
> Here is what the LEP call looks like…
> 
> ScriptPath:=$1
> $4D_Folder:=Get 4D folder(Active 4D Folder)
> $FileID:=String(Milliseconds)+"-"+String(Random)
> 
> Case of
> :  (32bit). //pseudo code
>   
> $FilePath:="C:\\Windows\\sysWoW64\\WindowsPowerShell\\v1.0\\powershell.exe 
> -file \""+$ScriptPath+"\”"
> 
> :  (32bit)
>   
> $FilePath:="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe 
> -file \""+$ScriptPath+"\""
>   
> End Case
> 
> $OutputStream:=$3
> $ErrorStream:=$4
> $XMLOutBlobPtr:=$5
>  //set the environmentals and launch the external process
> SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
> SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
> SET ENVIRONMENT VARIABLE("_4D_OPTION_CURRENT_DIRECTORY";$4D_Folder)
>  //SET ENVIRONMENT VARIABLE("_4D_OPTION_INPUT_STREAM";"I"+$FileID)
> SET ENVIRONMENT VARIABLE("_4D_OPTION_OUTPUT_STREAM";"O"+$FileID)
> SET ENVIRONMENT VARIABLE("_4D_OPTION_ERROR_STREAM";"E"+$FileID)
> SET ENVIRONMENT VARIABLE("_4D_OPTION_STOP_TOKEN";$FileID)
> LAUNCH EXTERNAL PROCESS($FilePath)
> —
> 
> ———
> The PowerSrcipt script looks like this…
> 
> [String]$requestXML = '
> 
> 
> 
> 
> 
> '
> $myQBXMLRP = New-Object -com QBXMLRP2.RequestProcessor
> $myQBXMLRP.OpenConnection2("qb4D","CCFolioPro",1)
> $ticket = $myQBXMLRP.BeginSession("C:\Company Files\Cadinha & Co., 
> LLC.QBW",$myQBXMLRP.qbFileOpenDoNotCare)
> $myQBXMLRP.ProcessRequest($ticket, $requestXML) > 
> $env:_4D_OPTION_OUTPUT_STREAM
> $myQBXMLRP.EndSession($ticket)
> $myQBXMLRP.CloseConnection()
> "Stop" > $env:_4D_OPTION_STOP_TOKEN
> 
> ---
> 
> 
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com
> 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: V17R3 vs PowerShell

2019-05-30 Thread JOHN BAUGHMAN via 4D_Tech
Oooops. Just noticed an error in the code I posted. The case statement should 
have read



On May 29, 2019, at 7:12 PM, JOHN BAUGHMAN  wrote:

Case of
:  (32bit PowerShell). //pseudo code. 

$FilePath:="C:\\Windows\\sysWoW64\\WindowsPowerShell\\v1.0\\powershell.exe 
-file \""+$ScriptPath+"\”"

:  (64bit PowerShell) //pseudo code

$FilePath:="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe 
-file \""+$ScriptPath+"\""

End Case


> On May 29, 2019, at 7:12 PM, JOHN BAUGHMAN  wrote:
> 
> Anyone using PowerShell on Windows 10 out there? Maybe you can help me figure 
> this out.
> 
> I am upgrading an old v13 database to v17. My ultimate goal is to have 
> everything run-in 64bit.
> 
> The database talks to QuickBooks on a Windows 10 machine using an XML stream 
> in a Powershell script file executed with PowerShell by LEP.
> 
> I have successfully upgraded all of 4D to run successfully 64 bit, but have 
> am unable to get v17R3 or R4 64bit client to work successfully with 64bit 
> PowerShell…
> 
> 
> 4DServer Client  PowerShell   
>   Result
> v17R364 32  32
> OK
> v17R3.   64 32  64
> OK
> 
> V17R36464   32
> OK
> V17R36464   64
>  X  
> 
> I am pretty sure that the PowerShell script is not being executed because 
> QuickBooks is not receiving a call. What changes with 64Bit 4d client that 
> could possibly be preventing the PowerShell Script from executing?  
> 
> I have posted the applicable code and ps script below.
> 
> Thanks,
> 
> John 
> 
> 
> Here is what the LEP call looks like…
> 
> ScriptPath:=$1
> $4D_Folder:=Get 4D folder(Active 4D Folder)
> $FileID:=String(Milliseconds)+"-"+String(Random)
> 
> Case of
> :  (32bit). //pseudo code
>   
> $FilePath:="C:\\Windows\\sysWoW64\\WindowsPowerShell\\v1.0\\powershell.exe 
> -file \""+$ScriptPath+"\”"
> 
> :  (32bit)
>   
> $FilePath:="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe 
> -file \""+$ScriptPath+"\""
>   
> End Case
> 
> $OutputStream:=$3
> $ErrorStream:=$4
> $XMLOutBlobPtr:=$5
>  //set the environmentals and launch the external process
> SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
> SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
> SET ENVIRONMENT VARIABLE("_4D_OPTION_CURRENT_DIRECTORY";$4D_Folder)
>  //SET ENVIRONMENT VARIABLE("_4D_OPTION_INPUT_STREAM";"I"+$FileID)
> SET ENVIRONMENT VARIABLE("_4D_OPTION_OUTPUT_STREAM";"O"+$FileID)
> SET ENVIRONMENT VARIABLE("_4D_OPTION_ERROR_STREAM";"E"+$FileID)
> SET ENVIRONMENT VARIABLE("_4D_OPTION_STOP_TOKEN";$FileID)
> LAUNCH EXTERNAL PROCESS($FilePath)
> —
> 
> ———
> The PowerSrcipt script looks like this…
> 
> [String]$requestXML = '
> 
> 
> 
> 
> 
> '
> $myQBXMLRP = New-Object -com QBXMLRP2.RequestProcessor
> $myQBXMLRP.OpenConnection2("qb4D","CCFolioPro",1)
> $ticket = $myQBXMLRP.BeginSession("C:\Company Files\Cadinha & Co., 
> LLC.QBW",$myQBXMLRP.qbFileOpenDoNotCare)
> $myQBXMLRP.ProcessRequest($ticket, $requestXML) > 
> $env:_4D_OPTION_OUTPUT_STREAM
> $myQBXMLRP.EndSession($ticket)
> $myQBXMLRP.CloseConnection()
> "Stop" > $env:_4D_OPTION_STOP_TOKEN
> 
> ---
> 
> 
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com
> 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: V17R3 vs PowerShell

2019-05-30 Thread JOHN BAUGHMAN via 4D_Tech
Not sure anyone is interested, but after a lot of research on line it appears 
that 64bit version of Powershell cannot call a 32bit dl and vice versa. This 
does not match the results I am getting with v17R3. 

In my previous post I left out that . 4D client is running on a 64bit Windows 
10 install, so in all my tests the system contained both a SysWow64 folder 
containing the 32bit version of PowerShell and a System32 folder containing the 
64bit version of PowerShell.

The following is more descriptive of my testing….

4D   OSServer & Client  4DServer  4DClient  
 PowerShell  DLL Result
v17R364   64
   32  3232OK
v17R3.   64   64
   32  6432OK.   //According to 
my research this should not work!

V17R3   6464
 64  32 32   OK
V17R3   6464
 64  64 32X  
//According to my research this is the expected behavior



Why is the 32 bit 4D client working when it uses 64bit PowerShell?

Hard to find answers for this. There is no forum that has folks that are expert 
in 4D, PowerShell, and Quickbooks.I am going to post my question on Stack 
Exchange, Intuit SDK forum, and the Powershell forum and see what I get.

If you got this far, thanks for reading. If I get an answer I will post it here.

John

> On May 29, 2019, at 7:12 PM, JOHN BAUGHMAN  wrote:
> 
> Anyone using PowerShell on Windows 10 out there? Maybe you can help me figure 
> this out.
> 
> I am upgrading an old v13 database to v17. My ultimate goal is to have 
> everything run-in 64bit.
> 
> The database talks to QuickBooks on a Windows 10 machine using an XML stream 
> in a Powershell script file executed with PowerShell by LEP.
> 
> I have successfully upgraded all of 4D to run successfully 64 bit, but have 
> am unable to get v17R3 or R4 64bit client to work successfully with 64bit 
> PowerShell…
> 
> 
> 4DServer Client  PowerShell   
>   Result
> v17R364 32  32
> OK
> v17R3.   64 32  64
> OK
> 
> V17R36464   32
> OK
> V17R36464   64
>  X  
> 
> I am pretty sure that the PowerShell script is not being executed because 
> QuickBooks is not receiving a call. What changes with 64Bit 4d client that 
> could possibly be preventing the PowerShell Script from executing?  
> 
> I have posted the applicable code and ps script below.
> 
> Thanks,
> 
> John 
> 
> 
> Here is what the LEP call looks like…
> 
> ScriptPath:=$1
> $4D_Folder:=Get 4D folder(Active 4D Folder)
> $FileID:=String(Milliseconds)+"-"+String(Random)
> 
> Case of
> :  (32bit). //pseudo code
>   
> $FilePath:="C:\\Windows\\sysWoW64\\WindowsPowerShell\\v1.0\\powershell.exe 
> -file \""+$ScriptPath+"\”"
> 
> :  (32bit)
>   
> $FilePath:="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe 
> -file \""+$ScriptPath+"\""
>   
> End Case
> 
> $OutputStream:=$3
> $ErrorStream:=$4
> $XMLOutBlobPtr:=$5
>  //set the environmentals and launch the external process
> SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
> SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
> SET ENVIRONMENT VARIABLE("_4D_OPTION_CURRENT_DIRECTORY";$4D_Folder)
>  //SET ENVIRONMENT VARIABLE("_4D_OPTION_INPUT_STREAM";"I"+$FileID)
> SET ENVIRONMENT VARIABLE("_4D_OPTION_OUTPUT_STREAM";"O"+$FileID)
> SET ENVIRONMENT VARIABLE("_4D_OPTION_ERROR_STREAM";"E"+$FileID)
> SET ENVIRONMENT VARIABLE("_4D_OPTION_STOP_TOKEN";$FileID)
> LAUNCH EXTERNAL PROCESS($FilePath)
> —
> 
> ———
> The PowerSrcipt script looks like this…
> 
> [String]$requestXML = '
> 
> 
> 
> 
> 
> '
> $myQBXMLRP = New-Object -com QBXMLRP2.RequestProcessor
> $myQBXMLRP.OpenConnection2("qb4D","CCFolioPro",1)
> $ticket = $myQBXMLRP.BeginSession("C:\Company Files\Cadinha & Co., 
> LLC.QBW",$myQBXMLRP.qbFileOpenDoNotCare)
> $myQBXMLRP.ProcessRequest($ticket, $requestXML) > 
> $env:_4D_OPTION_OUTPUT_STREAM
> $myQBXMLRP.EndSession($ticket)
> $myQBXMLRP.CloseConnection()
> "Stop" > $env:_4D_OPTION_STOP_TOKEN
> 
> ---
> 
> 
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com
> 

**
4D Internet Users Group (4D iNUG)
Archive:  

Re: V17R3 vs PowerShell

2019-05-31 Thread JOHN BAUGHMAN via 4D_Tech

> On May 30, 2019, at 9:40 PM, Epperlein, Lutz (agendo) 
>  wrote:
> 
> we use Powershell a lot, even in conjunction with 4D. But we never divide 
> between 32bit and 46bit-Powershell. Since you use the Powershell via LAUNCH 
> EXTERNEL PROCESS (LEP) the architecture (bitness) of the Powershell binary 
> shouldn't matter.

I am not sure I understand your statement here. LEP is launching either 
the 32bit or 64bit version of Powershell which in turn calls the dll. Is not 
LEP out of the picture at this point, thus the bitness must match between 
PowerShell and the dll or PowerShell is going to throw a "80040154 Class not 
registered” error.

> And a question: Regarding your script how do you determine the variables 
> '32bit PowerShell' and '64bit PowerShell'?
> I'm in doubt that you call the 64bit-Powershell using the 32bit-4D-Client. 
> Are 
> you really sure?

This process/code has been in place for many years. Up until now I 
insured that I was always using the 32bit version of PowerShell like this…

If (Test path name("C:\\Windows\\sysWoW64")=Is a folder)
  //This is a 64bit machine so I must use the 32bit version of PowrShell

$PS_Call:="C:\\Windows\\sysWoW64\\WindowsPowerShell\\v1.0\\powershell.exe -file 
\""+$ScriptPath+"\""

Else 
  //This is a 32bit machine and there is only 1 version of Powershell

$PS_Call:="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -file 
\""+$ScriptPath+"\""

End if 

LAUNCH EXTERNAL PROCESS($PS_Call)

Now that I am moving everything 4D to 64bit on a Windows 10 machine, 
and before I understood that you could not mix PowerShell and DLL bitness, I 
simply falsed out the test…

 If (False)  //(Test path name("C:\\Windows\\sysWoW64")=Is a folder)   //I know 
I am on Windows 10 a 64bit machine and I do not want to use the 32 bit version 
for this test

$PS_Call:="C:\\Windows\\sysWoW64\\WindowsPowerShell\\v1.0\\powershell.exe -file 
\""+$ScriptPath+"\""

Else 
  //Windows 10 is a 64 bit machine and my intention is to use the 64bit 
version of Powershell 
Trace

$PS_Call:="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -file 
\""+$ScriptPath+"\""

End if 

I have done this test many times, but just to make sure I reran the 
test with the R3 Client just now with a break before calling the 64bit version 
of PowerShell as above. QBXMLRP2 is a 32 bit dll so knowing what I know now, 
this should NOT work, but it does. Using the 64bit version of 4D Client it 
fails as I would expect.

> And I'm quite sure the cause of problem is the class ' 
> QBXMLRP2.RequestProcessor'. It seems to exist as 32bit on your system, so you 
> can use the 32bit-Powershell only. The dependency is between Powershell and 
> Quickbooks, not between 4D and Powershell regarding the bitness.

Exactly! So why does calling 64bit PowerSehll work using 32bit R3 
client?

Going forward I will just have to continue using 32bit PowerShell. I 
guess if Windows ever drops 32bit support, the ball will be in Intuit’s court 
to provide a 64bit version of the QBXMLRP2.dll. It’s just that I would like to 
really understand whey using  differing architectures of 4D would make a 
difference in R3. 

Thanks

John


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: V17R3 vs PowerShell

2019-05-31 Thread JOHN BAUGHMAN via 4D_Tech


> On May 30, 2019, at 10:13 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
>> QBXMLRP2.RequestProcessor
> 
> 
> is the QB SDK based on COM / OLE ?

Yes.

> but it does sound like the SDK is not installed in the client having a 
> problem.
> perhaps OLEVIEW.EXE could tell you if the class is available.

No the class is available as it works fine using 32bit PowerShell. I am 
just asking why, when using 32bit R3. does LEP calling the 64bit version of 
Powershell to execute a ps script that invokes a 32bit COM object work, when it 
shouldn’t.

John
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: V17R3 vs PowerShell

2019-06-01 Thread JOHN BAUGHMAN via 4D_Tech
Aloha Keith,

> The reason that you think the 64-bit PowerShell is working is because 
> actually the 32-bit PowerShell is still being used.
> 
> When a 32-bit application (in this case 4D) accesses the system32 directory, 
> those accesses are automatically redirected to the SysWow64 directory.
> 
> So when you use LEP to launch PowerShell and you think you've specified the 
> 64-bit version in system32, the OS is just launching the one from SysWow64.

That is the only thing that makes sense to me. Do you know this for 
certain. I was suspecting that this was the case but could not find anything 
that documents this behavior.

I had hoped that by having LEP display the console, I could tell which 
version of PowerShell was run. But the console only displays a path above an 
empty command window. When the 64bit version of PowerShell is launched by 32bit 
4D the path displayed in the console is in fact to PowerShell in the System32 
folder not SysWow. But I think that path only reflects the requested path from 
LEP, not which version of PowerShell is actually running. If LEP launches the 
32bit version the path is to PowersShell in the SysWow folder, otherwise the 
consoles looks exactly the same.

Thanks for your input. I think your spot on. It’s interesting to me 
that the OS is making the decision based on the architecture of the requesting 
application not the architecture of the dll. How does the OS otherwise know 
which to launch? Does that mean a 32bit 4D will not launch 64 bit PowerShell 
ever? When PowerShell is launched I do not think that the OS knows which or 
even if a dll is going to be addressed.

Enough already. I think I am beating a dead horse here.  I am moving 
on, but really do appreciate your input and all who have tried to straighten 
out this far too curious old fart’s brain.

John
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

ZipCenter... a blast from the past.

2019-06-01 Thread JOHN BAUGHMAN via 4D_Tech
Anyone besides me using ZipCenter?

It has worked great for me through all these years but the license I have fails 
now when running 64bit 16R6. ASG distributed it but ASG is no more, and David 
Adams who I believe wrote it does not have a clue about licensing aspects, 
which I am guessing Michael Erickson added to the plugin before he started 
distributing it. 

If anyone is using it and has it working with 64bit 4D, could you share your 
license with me? Otherwise I am going to move on to one of the web based zip 
code services. It twas nice having a self contained zip code library while it 
lasted.

BTW, does anyone know how Michael is doing these days. I always enjoyed his 
company at the Summits. Always full of energy.

John




John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Anyone using zipcodeapi

2019-06-01 Thread JOHN BAUGHMAN via 4D_Tech
Is anyone using zipcodeapi.com  to fill in city and 
state fields in a 4D database? Would you be willing to share your code?

Thanks,

John


John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Anyone using zipcodeapi

2019-06-01 Thread JOHN BAUGHMAN via 4D_Tech
Actually since I am in the early stage of development any suggestions in this 
regard are welcome. I see another web based Zip Code site call SmartyStreets. 
That would work as well. 

So any other suggestions would be greatly appreciated.

Thanks,

John

> On Jun 1, 2019, at 3:07 PM, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Is anyone using zipcodeapi.com <http://zipcodeapi.com/> to fill in city and 
> state fields in a 4D database? Would you be willing to share your code?
> 
> Thanks,
> 
> John
> 
> 
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Anyone using zipcodeapi

2019-06-01 Thread JOHN BAUGHMAN via 4D_Tech
Thanks Kirk. Yes after looking through the 2 I think zipcodeapi is the better 
choice. I registered my app and with a simple http request already have what I 
needed….

C_TEXT($response)
C_OBJECT($oResponse)
$$zipcode:="96734"
$clientKey:=“;alks;dlfakjldflajdkl"

$url:="https://www.zipcodeapi.com/rest/"+$clientKey+"/info.json/"+$zipcode+"/radians”
HTTP Request(HTTP GET method;$url;$content;$response)

   $oResponse:=JSON Parse($response)
   $city:=$oResponse.city
   $state=$oResponse.state

Didn’t think it would be that easy. Hope this post helps someone else down the 
line.

John



> On Jun 1, 2019, at 6:26 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> John,
> I've been using SmartyStreets for several years. It's very easy to connect
> with and the folks who run it are extremely helpful and friendly.
> 
> I looked at the website for zicodeapi.com and notice the service is less
> expensive and offers a number of APIs for working with zip codes. It's a
> solid suggestion.
> 
> 
> On Sat, Jun 1, 2019 at 10:06 PM JOHN BAUGHMAN via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Actually since I am in the early stage of development any suggestions in
>> this regard are welcome. I see another web based Zip Code site call
>> SmartyStreets. That would work as well.
>> 
>> So any other suggestions would be greatly appreciated.
>> 
>> Thanks,
>> 
>> John
>> 
>>> On Jun 1, 2019, at 3:07 PM, JOHN BAUGHMAN via 4D_Tech <
>> 4d_tech@lists.4d.com> wrote:
>>> 
>>> Is anyone using zipcodeapi.com <http://zipcodeapi.com/> to fill in city
>> and state fields in a 4D database? Would you be willing to share your code?
>>> 
>>> Thanks,
>>> 
>>> John
>>> 
>>> 
>>> John Baughman
>>> Kailua, Hawaii
>>> (808) 262-0328
>>> john...@hawaii.rr.com
>>> 
>>> **
>>> 4D Internet Users Group (4D iNUG)
>>> Archive:  http://lists.4d.com/archives.html
>>> Options: https://lists.4d.com/mailman/options/4d_tech
>>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>>> **
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> 
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> What can be said, can be said clearly,
> and what you can’t say, you should shut up about
> 
> *Wittgenstein and the Computer *
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Anyone using zipcodeapi

2019-06-02 Thread JOHN BAUGHMAN via 4D_Tech
> If the website is returning JSON, if you can just pass $oResponse instead of 
> $response and 4D will do the "JSON Parse” for you automatically. 

Tim, thanks. At first I did not understand, but got it now...

C_OBJECT($oResponse)
HTTP Request(HTTP GET method;$url;$content;$oResponse)

The HTTP Request command sees JSON coming in and an object for the response and 
automatically parses it in the object…. Neat. Thanks.

John



> On Jun 2, 2019, at 9:36 AM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> On Jun 2, 2019, at 2:00 PM, JOHN BAUGHMAN wrote:
> 
>> Thanks Kirk. Yes after looking through the 2 I think zipcodeapi is the 
>> better choice. I registered my app and with a simple http request already 
>> have what I needed….
>> 
>>   C_TEXT($response)
>>   C_OBJECT($oResponse)
>>   $$zipcode:="96734"
>>   $clientKey:=“;alks;dlfakjldflajdkl"
>>   
>> $url:="https://www.zipcodeapi.com/rest/"+$clientKey+"/info.json/"+$zipcode+"/radians”
>>   HTTP Request(HTTP GET method;$url;$content;$response)
>> 
>>  $oResponse:=JSON Parse($response)
>>  $city:=$oResponse.city
>>  $state=$oResponse.state
>> 
>> Didn’t think it would be that easy. Hope this post helps someone else down 
>> the line.
> 
> I had the same experience with Twilio for sending SMS from 4D. It was so easy 
> to use HTTP Request when the website has a well designed API.
> 
> If the website is returning JSON, if you can just pass $oResponse instead of 
> $response and 4D will do the "JSON Parse” for you automatically. 
> 
> Tim
> 
> *
> Tim Nevels
> Innovative Solutions
> 785-749-3444
> timnev...@mac.com
> *
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Invalid JSON?

2019-06-02 Thread JOHN BAUGHMAN via 4D_Tech
I am getting the following from zip-codes.com…

{
"item": {
"ID": "77252",
"Medicare_Rating_Area_ID": "1"
}
}

The list under item: s much much longer. If I use JASON Parse it throws an 
error….

JSON malformed in line 1, position 1

If I run it in the JSON Validtor at https://jsonlint.com it comes up valid.

What’s up with that? Can I fix the response so that it validates in 4D?

Thanks,

John



John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Invalid JSON?

2019-06-02 Thread JOHN BAUGHMAN via 4D_Tech
John,

After posting I found that the problem was an unknown leading character 
which does not get copied to the pasteboard with SET TEXT TO PASTEBOARD. So the 
posted text would not throw an error.

John

> On Jun 2, 2019, at 5:03 PM, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> What version of 4D? JSON Parse on what you provided below does not throw an 
> error with 4D 17.1.
> 
> John DeSoi, Ph.D.
> 
> 
> 
>> On Jun 2, 2019, at 8:05 PM, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> I am getting the following from zip-codes.com…
>> 
>> {
>>  "item": {
>>  "ID": "77252",
>>  "Medicare_Rating_Area_ID": "1"
>>  }
>> }
>> 
>> The list under item: s much much longer. If I use JASON Parse it throws an 
>> error….
>> 
>>  JSON malformed in line 1, position 1
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Invalid JSON?

2019-06-02 Thread JOHN BAUGHMAN via 4D_Tech
HI Keisuke,

Perhaps I should know, but what is a BOM? 

Using a BLOB for the response variable then converting to text did not 
delete the BOM. It did however reveal what it was…. ø

Using a BLOB has a couple of more steps the just passing a text 
variable.

I think the mystery has been solved and I have a good work around. 
Wonder if I should give the site some feedback about the problem.

Thanks,

John


> On Jun 2, 2019, at 5:08 PM, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> perhaps there is a BOM.
> 
> did you pass a C_TEXT to HTTP Request?
> 
> you might want to use a BLOB,
> then Convert to text (which will get rid of the BOM),
> then parse.
> 
> 2019/06/03 10:05、JOHN BAUGHMAN via 4D_Tech 
> <4d_tech@lists.4d.com<mailto:4d_tech@lists.4d.com>>のメール:
> 
> JSON malformed in line 1, position 1
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Invalid JSON? - solved

2019-06-02 Thread JOHN BAUGHMAN via 4D_Tech
There is a gremlin in the response. I cannot see it in the debugger , but the 
leading character is not (. If I set it to the pasteboard and paste it the JSON 
Validator it disappears as well if I paste it into a text editor.

The following fixes it…

If (Substring($Response;1;1)#"{")   
Repeat 
$Response:=Delete string($Response;1;1)
Until (Substring($Response;1;1)="{") | ($Response="")
End if 

John


> On Jun 2, 2019, at 3:05 PM, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I am getting the following from zip-codes.com…
> 
> {
>   "item": {
>   "ID": "77252",
>   "Medicare_Rating_Area_ID": "1"
>   }
> }
> 
> The list under item: s much much longer. If I use JASON Parse it throws an 
> error….
> 
>   JSON malformed in line 1, position 1
> 
> If I run it in the JSON Validtor at https://jsonlint.com it comes up valid.
> 
> What’s up with that? Can I fix the response so that it validates in 4D?
> 
> Thanks,
> 
> John
> 
> 
> 
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Zip Code API sites - Follow up

2019-06-03 Thread JOHN BAUGHMAN via 4D_Tech
Should someone in the future be looking for a Zip Code lookup api, here is what 
I found…

https://www.zipcodeapi.com
Includes… City, State Abbreviation, Time Zone, Daylight Savings, 
Latitude, Longitude. (US Only)
Free limits…. 10/hour, 240/day Application registration required

https://zippopotam.us
   Includes… City, State, State Abbreviation, Latitude, Longitude (US API plus 
APIs for 47 other countries but you have to know the country to use each API)
   Free limits….   Unlimited  No registration Open Database License

https://www.zip-codes.com/zip-code-api.asp
Includes… Canadian Street Address, City, State Abbreviation, FPIS, County, 
County FPIS, Area Code,Time Zone, Daylight Savings, Latitude, Longitude… +++  
(US & Canada)
Free limits….  250/month

These are the 3 best that I found. 

Zipcodeapi.com has everything I needed except Area Code with a very generous 
free limit.
Xippotam.us was missing much of what I needed, area code/time zone/DST, but you 
cannot beet 100% free.
Zip-codes is the cat’s meow. Everything I needed and then some. The best of the 
bunch.

I ended up putting them all in my database with zip-codes the default. The end 
users can pick amongst the three.

They are all very easy to setup. If anyone needs code samples, give me a 
holler. I tempted to try my hand at my first component.

John



John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Zip Code API sites - Follow up

2019-06-03 Thread JOHN BAUGHMAN via 4D_Tech
Jermy,

Zipcodeapi.com has an API for Great Britain. Look at the list of 
countries near the bottom of the page. Example URLs are shown in th list. Here 
is a sample 4D call…

$url:="http://api.zippopotam.us/GB/“+vZip. //AB1 for 
example
HTTP Request(HTTP GET method;$url;$content;$oResponse)

John

> On Jun 3, 2019, at 8:59 AM, Jeremy Roussak via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Out of curiosity, does anyone know of an equivalent service for postcodes in 
> the UK?
> 
> Jeremy
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Zip Code API sites - Follow up

2019-06-04 Thread JOHN BAUGHMAN via 4D_Tech
Ooops. Sorry. Copy and pasting is not always the best way to do things. Thanks 
for pointing that out.

John

> On Jun 3, 2019, at 9:41 PM, Jeremy Roussak via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> John, thanks very much; I shall investigate. One point: unless I’m missing 
> something (not unusual) it’s not zipcodeapi.com <http://zipcodeapi.com/> 
> (your first link) which has UK codes, but zippopotam.us 
> <http://zippopotam.us/> (your second).
> 
> Jeremy
> 
>> On 3 Jun 2019, at 20:23, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> Jermy,
>> 
>>  Zipcodeapi.com has an API for Great Britain. Look at the list of 
>> countries near the bottom of the page. Example URLs are shown in th list. 
>> Here is a sample 4D call…
>> 
>>  $url:="http://api.zippopotam.us/GB/“+vZip. //AB1 for 
>> example
>>  HTTP Request(HTTP GET method;$url;$content;$oResponse)
>> 
>> John
>> 
>>> On Jun 3, 2019, at 8:59 AM, Jeremy Roussak via 4D_Tech 
>>> <4d_tech@lists.4d.com> wrote:
>>> 
>>> Out of curiosity, does anyone know of an equivalent service for postcodes 
>>> in the UK?
>>> 
>>> Jeremy
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v15 to v17 Conversion of Obsolete _o_C_STRING/_o_ARRAY STRING Commands

2019-06-07 Thread JOHN BAUGHMAN via 4D_Tech

> On Jun 7, 2019, at 6:02 AM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> - Run compiler, fix individual errors, or notice sizes you missed above 
> and do global replaces using C_Text(;  -> C_Text(


 Rather than rerunning the compiler…

1. Find In Design for _o_C_String( Leave this window open
2. Find id Design for _o_C_String(x;  If any found, do the 
first one found
3. Replace in content _o_C_String(x;   ->  C_Text(   When done, 
close the window
4. Refresh the first Find In Design window
5. Repeat 2 - 4 until none found
6. Close first FID window and do FID for starts with _o_handle what 
is left.

I think this might be a bit quicker than dealing with the compiler each time.

John

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Using TRANSFORM PICTURE Crop in a Scaled to fit (Proportional) picture variable

2019-06-08 Thread JOHN BAUGHMAN via 4D_Tech
Ha anyone this and be willing to share their code”

I have been trying to relate a selected area on the scaled picture to unscaled 
picture without any success figuring out the math.

I am displaying the image in a fixed size variable on a form (819X550 odd 
numbers I know). The user selects the desired area to crop using a cropping 
tool I created on the scaled image. I read the coordinates from the cropping 
tool and then use TRANSFORM PICTUE to crop the image.

Unfortunately TRANSFORM PICTURE applies the cropping coordinates to the full 
size picture not the scaled picture, which of course is way off. So I figured I 
need to apply a factor to the cropping coordinate equal to the difference 
between the size of the Picture Variable and the original image size. NOT! I 
think the proportional throws everything off.

Is there a mathematical way to do this? Or perhaps another way to get this 
cropping to work?

Thanks,

John




John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using TRANSFORM PICTURE Crop in a Scaled to fit (Proportional) picture variable

2019-06-08 Thread JOHN BAUGHMAN via 4D_Tech
Keisuke, 

Thanks for the helpful response. I had not thought about scaling the image 
manually. It took awhile, but I finally got the math right…. It works!!

> is there a reason why your image is scaled on screen?

If I understand the question, a user is manually cropping the image 
using a marque tool and so needs to see the whole image at once without 
scrolling. 

> the scaling factor of a proportional image depends on its orientation and the 
> type of scaling you apply (e.g. xMidYMid):
> 
> c.f. 
> https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio
>  
> 

Thanks for the link. While I did not understand it very well, it did 
remind me that the math is different depending on which is larger on the 
original picture, width or height.

> unlike resampling with CREATE THUMBNAIL,
> scaling with TRANSFORM PICTURE does not reduce the image quality.
> the result is the same as letting the form object do the scaling,
> except you have control over the ratio.

Yep. The results are great. 

Thanks again,

John




**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

V17 current release vs R-release

2019-06-15 Thread JOHN BAUGHMAN via 4D_Tech
I have been doing an upgrade to v17 64bit for a client and working using the 
latest R release. I am having second thoughts about deploying the R-release 
version. I see that I can open the  structure no problem with v17.2.

Any thoughts with regard to the soundness of deploying a structure that has 
been upgraded to v17R4 using v17.2?

The compiler should tell me if I have used any commands that did not exist in 
v17.2, but not any that were modified. Don’t think I have done so, but think 
this is one problem that may be an issue.

Thanks,
John


John Baughman
1331 Auwaiku Street
Kailua, Hawaii  96734
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: [Tip]Set Query Destination

2019-06-21 Thread JOHN BAUGHMAN via 4D_Tech
I use a macro whenever I call SET QUERY DESTINATION…




SET QUERY DESTINATION(;)

SET QUERY DESTINATION(Into current selection)

So if I write…
Query([Patient];[Patient]Dentist_Name="John Baughman")

Then realize I need to a query destination other than the current selection I 
highlight the above line of code and call the macro, I get…

SET QUERY DESTINATION(;)
QUERY([Patient];[Patient]Dentist_Name="John Baughman")
SET QUERY DESTINATION(Into current selection)

Cursor is now right after the first open parenthesis. Never miss putting it 
back to current selection.

Hope someone out there finds this useful.

John


> On Jun 21, 2019, at 6:30 AM, Charles Miller via 4D_Tech 
> <4d_tech@lists.4d.com> wrote
> :
> 
> Also I would bet crash wa due to undefined variable and not set query
> destination.
> 
> Regards
> 
> Chuck
> 
> On Fri, Jun 21, 2019 at 10:38 AM Douglas von Roeder via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Chip:
>> 
>> When Set query limit and Set query destination came out, I ran into the
>> situation where queries “stopped working” because I had forgotten to add
>> the code to reset them. To avoid that, I made it a practice to type the
>> “reset” code *before* I type the code to change the destination or limit
>> from their normal settings.
>> 
>> --
>> Douglas von Roeder
>> 949-336-2902
>> 
>> 
>> On Fri, Jun 21, 2019 at 6:50 AM Chip Scheide via 4D_Tech <
>> 4d_tech@lists.4d.com> wrote:
>> 
>>> [Tl;DR] at end
>>> 
>>> This command is your friend - and - your foe!  :)
>>> 
>>> Yesterday I spent a significant amount of time trying to track down a
>>> compiled/built app crash, but did/does not happen interpretedly.
>>> 
>>> The crash happened only occasionally, after placing alerts and asserts,
>>> I determined that the crash was happening in a utility method which was
>>> doing a query. A method which, in the running code, had already been
>>> called repeatedly - without - issue.
>>> Since the method which was doing the query had been called repeatedly
>>> -before- the crash, I was perplexed as to what the issue was.
>>> After some more poking and prodding, it appeared that the crashing only
>>> occurred in the utility method, after a specific method (X) was called.
>>> Looking at X and watching it execute (interpretedly) provided no
>>> obvious clue as what the cause was.
>>> After staring at the code, and running both interpretedly and built
>>> many more times it finally dawned on me what the issue was...
>>> Set Query Destination
>>> 
>>> In method X I was doing some work looking for duplicate data, and in so
>>> doing I was loping over a code that looked like this:
>>> Set Query Destination(Into variable;$Local)
>>> 
>>> Set Query destination(Into current selection)
>>> 
>>> Set Query Destination(Into variable;$Local)
>>> 
>>> You might see the issue now...
>>> It turns out I never returned the query destination back to Current
>>> Selection.
>>> To make the problem even more challenging, the utility method where the
>>> query was crashing was in a component.
>>> 
>>> Interpretedly, 4D was happy to create and type the local any time a
>>> query was executed after query destination was left into a local
>>> variable but... Needless to say compiled/built 4D DID NOT LIKE
>>> THAT!  :)
>>> 
>>> [TL;DR]
>>> -- always -- reset your query destinations  :)
>>> Chip
>>> ---
>>> Gas is for washing parts
>>> Alcohol is for drinkin'
>>> Nitromethane is for racing
>>> **
>>> 4D Internet Users Group (4D iNUG)
>>> Archive:  http://lists.4d.com/archives.html
>>> Options: https://lists.4d.com/mailman/options/4d_tech
>>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>>> **
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> -- 
> -
> Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
> Informed Solutions, Inc.
> Brookline, MA 02446 USA Registered 4D Developer
>   Providers of 4D, Sybase & SQL Server connectivity
>  https://www.informed-solutions.com
> -
> This message and any attached documents contain information which may be
> confidential, subject to privilege or exempt from disclosure under
> applicable law.  These materials are intended only for the use of the
> intended recipient. If you are not the intended recipient of this
> transmission, you are hereby notified that any distribution, disclosure,
> printing, copying, storage, modification or the taking of any acti

HTTP connection to 4D server thru Mac FIrewall

2019-06-22 Thread JOHN BAUGHMAN via 4D_Tech
Client wants to turn on the firewall on the 4D server machine. We have an iOS 
app that requests data from the 4D server which stops connecting with the 
FireWall on. I tried adding 4D server to the allowed apps in Advanced setting 
of the Firewall. 

I also have a Xojo web app that works, but it uses localhost to connect to 4D 
server.

Any suggestions?

Thanks,

John

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

HTTP connection to 4D server thru Mac FIrewall

2019-06-22 Thread JOHN BAUGHMAN via 4D_Tech
Client wants to turn on the firewall on the 4D server machine. We have an iOS 
app that requests data from the 4D server which stops connecting with the 
FireWall on. I tried adding 4D server to the allowed apps in Advanced setting 
of the Firewall. 

I also have a Xojo web app that works, but it uses localhost to connect to 4D 
server.

Any suggestions?

Thanks,

John

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Rotate Picture

2019-06-22 Thread JOHN BAUGHMAN via 4D_Tech
Is it possible to rotate a picture using native 4D commands? Google search 
finds references to Miyako’s rotate picture component, SVG, GitHub, etc.

I do not see any way to do it with Transform Picture.

If not 4D commands, what is the quickest and easiest way to rotate a picture in 
a picture variable? Anyone got code they could share?

Thanks,

John


John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Rotate Picture

2019-06-22 Thread JOHN BAUGHMAN via 4D_Tech
Thanks Cannon.

Your code looked vaguely familiar to me. I had not thought to look and see if I 
already had a method to rotate pictures. Sure enough I do. Looks very similar 
to yours, even uses the same  variable conventions. Perhaps you gave this to me 
back in 2011?

In any event thanks. I am going to use your method as it is a bit more compact 
than mine. Mine is a tad faster, however. I posted mine below for comparison.

John


——]
C_PICTURE($1;$MyPicture)
C_LONGINT($2;$rotation)
  // 
$error:=SVG_Set_error_handler ("SVG_error_mgmt")
$MyPicture:=$1
$rotation:=$2
$temporaryPictureFilePath:=Temporary folder+"tempPicture.jpg"
WRITE PICTURE FILE($temporaryPictureFilePath;$MyPicture)  //write the 
picture to file so we can get it with a URL

PICTURE PROPERTIES($MyPicture;$width;$height)

If ($width>=$height)  //get the largest dimension of the picture
$svgAreaSize:=$width
Else 
$svgAreaSize:=$height
End if 

$SVGRef:=SVG_New ($svgAreaSize;$svgAreaSize)  //make the new SVG area 
big enough to hold the picture rotated

If ($width>=$height)  //center the picture in the SVG area 
$picRef:=SVG_New_image 
($SVGRef;"file://"+$temporaryPictureFilePath;0;($width/2)-($height/2);$width;$height)
Else 
$picRef:=SVG_New_image 
($SVGRef;"file://"+$temporaryPictureFilePath;($height/2)-($width/2);0;$width;$height)
End if 

SVG_SET_TRANSFORM_ROTATE 
($picRef;$rotation;$svgAreaSize/2;$svgAreaSize/2)  //rotate it

$MyPicture:=SVG_Export_to_picture ($SVGRef)  //The image is correctly 
rotated but is now in a square picture

Case of   //crop the picture back down to the size of the image if the 
image is not square
: ($width>$height)
TRANSFORM 
PICTURE($MyPicture;Crop;($width/2)-($height/2);0;$height;$svgAreaSize)
: ($height>$width)
TRANSFORM 
PICTURE($MyPicture;Crop;0;($height/2)-($width/2);$svgAreaSize;$width)
End case 

$0:=$MyPicture

 

> On Jun 22, 2019, at 11:37 AM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi John,
> 
> Here is the code from a method I use called Photo_Rotate:
> 
>  //This method rotates a picture. While it will rotate the picture to
>  //any angle, this method is really expecting it to rotate 90˚, 180˚,
>  //or 270˚.
> 
> C_PICTURE($1;$gPicture)
> C_REAL($2;$rDegrees)  //Expects 90, 180, or 270
> C_PICTURE($0)
> 
> $gPicture:=$1
> $rDegrees:=$2
> 
> C_LONGINT($lWidth;$lHeight)
> C_TEXT($svgRef;$imageRef)
> 
> PICTURE PROPERTIES($gPicture;$lWidth;$lHeight)
> $svgRef:=SVG_New ($lWidth;$lHeight)
> $imageRef:=SVG_New_embedded_image ($svgRef;$gPicture;0;0;".jpeg")
> 
> If (($rDegrees=90) | ($rDegrees=270))
>   SVG_SET_TRANSFORM_ROTATE ($imageRef;$rDegrees;($lHeight/2);($lWidth/2))
>   SVG_SET_TRANSFORM_TRANSLATE 
> ($imageRef;(($lHeight-$lWidth)/2);(($lWidth-$lHeight)/2))
>   DOM SET XML 
> ATTRIBUTE($svgRef;"height";String($lWidth);"width";String($lHeight))
> Else   //180
>   SVG_SET_TRANSFORM_ROTATE ($imageRef;$rDegrees;($lWidth/2);($lHeight/2))
> End if 
> 
> $0:=SVG_Export_to_picture ($svgRef)
> SVG_CLEAR ($svgRef)
> 
> HTH.
> 
> --
> Cannon.Smith
> Synergy Farm Solutions Inc.
> Aetna, AB Canada
> 
> 
> 
> 
>> On Jun 22, 2019, at 3:34 PM, JOHN BAUGHMAN via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> If not 4D commands, what is the quickest and easiest way to rotate a picture 
>> in a picture variable? Anyone got code they could share?
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Indexing taking a log time to reindex

2019-06-26 Thread JOHN BAUGHMAN via 4D_Tech
We have been having major thuderstorms on the Islands these last couple of 
days, and after a second power outage at one of my client sites their database 
had to be recovered from backup. I had problems with the log file, but 
eventually got it back up and the log file integrated. 

In the process I noticed that one of the tables with 52k records and many 
indeed fields, was taking a very long time to index each field. This particular 
table takes over 3  minutes to reindex each indexed field.   I have other 
tables with over 250k records and close to as many index fields where the whole 
table is reindexed in less than a minute. 

These fields are mostly long int, with a number of alpha and boolean field 
thrown into the mix. All seem to take about the same amount of time to index.

As it is what probably should only take about 15 to 20 mins to go through the 
reindexing process, is taking well over an hour. All of the field’s indexing 
method are set to Automatic.

Is this normal? Is there anything I can do to speed them up short of unindexing 
some of them? Are different indexing methods faster than others?

Thanks,

John


John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Indexing taking a log time to reindex

2019-06-26 Thread JOHN BAUGHMAN via 4D_Tech

> perhaps the reindexing of the 250k table has saturated the cache, leaving 
> little space the smaller table.
> 
> FLUSH CACHE (FLUSH BUFFERS) with the * could be used to purge objects from 
> the cache, if that's the case.

Miyako, I think you may have a point as the problem table appears to be 
one of the last, if not the last.

This is really only a problem when the reindex is automatically 
generated on startup, more than likely after a unexpected shut down during the 
clinic’s working hours, in which case how does one insert a FLUSH CACHE (FLUS 
BUFFERS) into the process? It’s not a problem for me if I am forcing a reindex 
after hours.

> also 15R4 improved the indexing process

This is v16R4.

John


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Importing from camera

2019-07-07 Thread JOHN BAUGHMAN via 4D_Tech
What options are there, native or otherwise, for importing pictures directly 
from a camera?

Thanks,

John




John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Get System Info vs PLATFORM PROPERTIES

2019-07-14 Thread JOHN BAUGHMAN via 4D_Tech
So PLATFORM PROPERTIES has been deprecated in favor of Get System Info. Get 
System Info is far ore informative,  but am I the only one finding the text 
values of some of the properties near impossible to work with in a consistent 
manner across multiple platforms? Specifically osVersion and processor.

For example. If you need, for whatever reason, to know what OS version 4D is 
running in, osVersion might return…

Microsoft Windows 10 Professionnel 10.0.14393
OR
macOS 10.13.6 (17G7024)

Unless I am not seeing a way, how can one parse the returned value to get a 
usable value across multiple platforms now and going forward? PLATFORM 
PPROPERTIES returned a Long Integer that you could work with. 

For osVersion, I think it would help if there was a property that just returned 
the long int value of the os, ie. osVersioinNumber -> 10.0.14393  

Not sure what could be done for processor. 

John


John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows Server 2012 & 4D Server v17.2

2019-07-19 Thread JOHN BAUGHMAN via 4D_Tech
Have the clients tried connecting using a Custom address… 192.16..1.150:19813 
for example? I have found that for some of my windows installations This was 
necessary to make a connection, after which the recent connection created can 
be used.

John



John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

> On Jul 19, 2019, at 4:17 AM, Jody Bevan via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I do not have access to the Windows Server Administration window (only to 4D 
> Server Window). 4D Server has been working fine there. A restart of the 4D 
> Server to put up an application update,  (that works on a server in our shop) 
> and now the clients cannot see 4D Server broadcasting.
> 
> I have gone into 4D server to ensure that it is broadcasting on 19813 and the 
> 4D Admin window says that it is. It even shows network activity in that 
> window. No clients can connect to the server. A 4D Client running on the 
> server computer cannot connect either.
> 
> If I had access to the Windows Server Administration window I would poke 
> around to try and find something (like the firewall on) causing this. 
> 
> Any pointers on what I should check for?
> 
> I am not used to having client controlled servers.
> 
> Jody
> ARGUS Productions Inc.
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Microsoft Azure & 4D

2019-07-19 Thread JOHN BAUGHMAN via 4D_Tech
I have a deployed database that is currently using AWS. We have 200gb of PDFs 
stored on the same machine as 4D server. A Xojo Web App displays the available 
PDFs, when the end user requests one of the PDFs Xojo sends the request to 4D 
and 4D returns the PDF.

At the present time we are using AWS to handle large files that stall our the 
Xojo web app, by uploading the file to AWS and sending an email link to the 
file to the requesting user. This all works great.

Now the client wants to move the PDF archive to the cloud and have 4D serve 
them all from the ASW cloud. I do not see that should be any problem using 
Bruce Legay’s excellent AWS Component.

Now the client suddenly has expressed a desire to use Microsoft Azure instead 
of AWS. So my question to you all are…

1. Is anyone out there using Azure for data storage and retrieval? If 
so any suggestions on where to look for help ie. Component or plug in. I don’t 
see anything in the knowledge base.

2. Any thoughts on the pros and cons between using Azure or AWS.

Thanks,

John




John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Microsoft Azure & 4D

2019-07-20 Thread JOHN BAUGHMAN via 4D_Tech
First my apologies to Bruno for mutilating his name. While no excuse, I want to 
point the finger at auto complete as I remember copy and pasting to be sure I 
got it right.

Kirk, thanks for the link to transloadit. Very interesting service. I am not 
yet sure how it might benefit my current deployment, but will be looking more 
clowely at it as I move forward.

John

 

> On Jul 19, 2019, at 2:13 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> John,
> I have been using Bruno's AWS component for a few years myself. I'm going
> to be moving away from using the component soon. Not because of a problem
> with it but because I'm changing the way files are put into AWS. I'm
> looking at a service for managing file transfers called Transloadit
> <https://transloadit.com/>. They have 'robots' pre-configured to transfer
> files to Azure, AWS, Dropbox, Instagram and others. And it's really easy.
> It's not free but it looks pretty good so far.
> 
> What I particularly like is being able to defined a URL to receive a
> notification for each file. I set up an API to receive these and update the
> database with the specifics.
> 
> On Fri, Jul 19, 2019 at 3:33 PM JOHN BAUGHMAN via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> I have a deployed database that is currently using AWS. We have 200gb of
>> PDFs stored on the same machine as 4D server. A Xojo Web App displays the
>> available PDFs, when the end user requests one of the PDFs Xojo sends the
>> request to 4D and 4D returns the PDF.
>> 
>> At the present time we are using AWS to handle large files that stall our
>> the Xojo web app, by uploading the file to AWS and sending an email link to
>> the file to the requesting user. This all works great.
>> 
>> Now the client wants to move the PDF archive to the cloud and have 4D
>> serve them all from the ASW cloud. I do not see that should be any problem
>> using Bruce Legay’s excellent AWS Component.
>> 
>> Now the client suddenly has expressed a desire to use Microsoft Azure
>> instead of AWS. So my question to you all are…
>> 
>>1. Is anyone out there using Azure for data storage and retrieval?
>> If so any suggestions on where to look for help ie. Component or plug in. I
>> don’t see anything in the knowledge base.
>> 
>>2. Any thoughts on the pros and cons between using Azure or AWS.
>> 
>> Thanks,
>> 
>> John
>> 
>> 
>> 
>> 
>> John Baughman
>> Kailua, Hawaii
>> (808) 262-0328
>> john...@hawaii.rr.com
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> 
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> What can be said, can be said clearly,
> and what you can’t say, you should shut up about
> 
> *Wittgenstein and the Computer *
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Where is this resource file

2019-07-28 Thread JOHN BAUGHMAN via 4D_Tech
I have a picture button that is using a Resource  File with an ID number. I 
need to convert it to a png but do not have a clue where it is. I think it 
should be in the Resource folder. Once I find it, I think I should move it 
there??

Thanks,

John

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Where is this resource file

2019-07-28 Thread JOHN BAUGHMAN via 4D_Tech
The link talks about automatically inserting the reference as a file path. In 
this case the Source is Resource file and the Name/ID is 17836. If I right 
click the button and select Edit Picture it takes me to the picture library, 
but a picture with a 17836 ID does not exist. Nor does anything that might be 
it appear in the Resource Folder.

Is there a way to convert this picture directly in the button?

John



> On Jul 28, 2019, at 1:52 AM, Jeremy French  <mailto:jeremyfre...@mac.com>> wrote:
> 
> Have you looked at “Automatic referencing of picture files”? 
> 
> https://doc.4d.com/4Dv17R5/4D/17-R5/Using-static-pictures.300-4163735.en.html#4096601
>  
> <https://doc.4d.com/4Dv17R5/4D/17-R5/Using-static-pictures.300-4163735.en.html#4096601>
> 
> 
>> On Jul 28, 2019, at 4:37 AM, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com 
>> <mailto:4d_tech@lists.4d.com>> wrote:
>> 
>> I think it should be in the Resource folder
> 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Where is this resource file

2019-07-28 Thread JOHN BAUGHMAN via 4D_Tech
Thanks Miyako, but I am still stymied. The picture in the picture button looks 
good (v17R3 32bit).  

So I did…

C_PICTURE($picture)
GET PICTURE RESOURCE(17836;$picture)

Also tried GET RESOURCE("PICT";17836;$picture)

And tried GET ICON RESOURCE(17836;$picture)

$picture comes back empty. So based on what you said there must be more than 
one .rsr file open. How do I find which .rsr files are open? I do not have any 
.rsr files in my Resources folder and I can’t find any .rsr files anywhere on 
my hard disk that looks like it belongs to this database.

BTW the Picture button looks fine in 64bit mode. So maybe I should just ignore 
this warning in the verify log.

John

> 
> On Jul 28, 2019, at 2:42 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> so if there is a PICT resource in both a.RSR and b.RSR,
> GET PICTURE RESOURCE returns a different image depending on which file you 
> opened last.
> 
> if already see the correct image in design mode,
> you can simply call GET P. RESOURCE passing the ID.
> 
> if not, you need to first Open R. file and then use the command.
> 
> once the image is loaded in a picture variable,
> you can use TRANSFORM P. and WRITE P. FILE or CONVERT P.
> to map the white pixel to alpha and convert the format to .PNG.
> 
> if the PICT has a MASK resource, you need to call GET RESOURCE,
> if the image is a cicn (colour icon), you need to call GET ICON RESOURCE.
> 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Where is this resource file

2019-07-29 Thread JOHN BAUGHMAN via 4D_Tech
Thanks Jermy. I tried your suggestion and found no resource with a matching ID 
or name that describes the picture.

FYIW, I created this button back in 2004 after seeing a Summit presentation by 
David Batton on how to create a mask object on a form. Using the presented 
technique I used a simple rectangle in 4 picture buttons to create a cropping 
rectangle that a user can resize over a picture to indicate the desired 
cropping. I no longer have the summit presentation notes and the knowledge base 
does not go back that far. Does anyone have these presentation notes. I think 
if I can see how I created the picture buttons, I can figure out how to convert 
the picture.

John



> On Jul 28, 2019, at 6:19 PM, Jeremy French  wrote:
> 
> I suggest you try the following to see what 4D reports as resources.
> 
> Use the RESOURCE TYPE LIST command to get a list of all resource types:
> 
> RESOURCE TYPE LIST ( resTypes {; resFile} )
> 
> Omit the resFile parameter so you get all open resource types.
> 
> Then build a list of individual resources found by iterating over each 
> resTypes and calling RESOURCE LIST for that resTypes. Omit the resFile 
> parameter so you get all open items:
> 
> RESOURCE LIST ( resType ; resIDs ; resNames {; resFile} )
> 
> Put the resulting list (which will have 3-columns: “ResType”, “ResIDs”, 
> “ResNames”) in a list box.

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Where is this resource file

2019-07-29 Thread JOHN BAUGHMAN via 4D_Tech
> to be clear, do you not have an RSR file at all.


I guess that is the crux of my question. I don’t know as I cannot find one.

I somehow think that the button does not aurally hold a resource picture. I 
have 2 forms with the same picture forms. Only 1 form throws the warning in the 
verify log. The picture buttons are exactly the same in both forms. so…

1. If I remove the buttons from the form that throws the warning the 
structure passes the verification.

2. If I replace the button in the form that throws the warning with the 
buttons from the form that doesn’t, it passes the verification.

Remember the buttons are exactly the same… same resource ID, same size, 
same locations, etc.

It looks like I have resolved my immediate issue with being able to convert the 
pictures. The question still remains, however. Where or how is this picture 
referenced by the picture buttons. I am willing to ignore the conundrum at this 
point, but am still curious.

John

> On Jul 28, 2019, at 9:45 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> to be clear, do you not have an RSR file at all.
> or were you unable to locale any resources (PICT, cicn, MASK...) inside your 
> RSR file?
> 
> if you are on Mac, it could be that the structure file is forked and the 
> resource is inside the resource fork.
> 
>> 2019/07/29 16:04、JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com>のメール:
>> 
>> Thanks Jermy. I tried your suggestion and found no resource with a matching 
>> ID or name that describes the picture.
>> 
>> FYIW, I created this button back in 2004 after seeing a Summit presentation 
>> by David Batton on how to create a mask object on a form. Using the 
>> presented technique I used a simple rectangle in 4 picture buttons to create 
>> a cropping rectangle that a user can resize over a picture to indicate the 
>> desired cropping. I no longer have the summit presentation notes and the 
>> knowledge base does not go back that far. Does anyone have these 
>> presentation notes. I think if I can see how I created the picture buttons, 
>> I can figure out how to convert the picture.
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

User and Group information error on validation

2019-07-31 Thread JOHN BAUGHMAN via 4D_Tech
I am getting the following error…

The group 15003 is referencing a nonexistent member -16.(0,0)

No clue how to fix it. I am getting several of these errors.

John

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Another validation issue - orphaned method resource

2019-07-31 Thread JOHN BAUGHMAN via 4D_Tech
I am getting a bunch of warnings in the Check Orphan Methods section that say…

Warning: The method resource CC4D of id 19001 is not used anywhere.(0,0)

Of course with a different id.

I don’t have any orphaned methods. What is a method resource and how do I get 
rid of them.

John

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: User and Group information error on validation

2019-07-31 Thread JOHN BAUGHMAN via 4D_Tech
I fixed the Users and Groups errors by….

1. Open Groups in the Toolbox   
2. Select an offending group
3. Deselect the first selected member in the group (in my case 
Administrator)
4. Select the next group down or up.
5. Reselect the offending group selected in step 2 and reselect the 
member that was deselected in step 3.
6. Repeat 1-5 for each offending group.

Only thing left now is the orphaned method resources.

John

> On Jul 31, 2019, at 10:16 AM, Kenneth Geiger via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> John,
> 
> Just a thought…might this error relate to a “group” of objects (perhaps 
> radio-buttons??) on a form and not to a “Users & Groups” Issue?
> 
> Regards,
> 
> Ken
> 
>> On Jul 31, 2019, at 2:03 PM, JOHN BAUGHMAN via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> I am getting the following error…
>> 
>> The group 15003 is referencing a nonexistent member -16.(0,0)
>> 
>> No clue how to fix it. I am getting several of these errors.
>> 
>> John
>> 
>> John Baughman
>> Kailua, Hawaii
>> (808) 262-0328
>> john...@hawaii.rr.com
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Windows shutdown with 4D Server running as a service

2019-08-08 Thread JOHN BAUGHMAN via 4D_Tech
What is the best practice for shutting down a windows computer when 4D Server 
is running as a service?

I have been opening the administration window too see if there are any users 
connected. If so, I have been disconnecting them before shutting down the 
computer.

Just shutting down the computer seems to work as well, but what does 4D server 
do in this case?

Thanks,

John



John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows shutdown with 4D Server running as a service

2019-08-08 Thread JOHN BAUGHMAN via 4D_Tech
I am assuming that your Administrative function runs on a client? Sounds like a 
good idea, but wondering if it might be a bit over kill for me. 

Bottom line is that at some point the server is quit without regard to who is 
logged in at the time whether done with a quit command or issued by the Windows 
service. The admin can see who is logged by firing up a client on the server 
and opening the Administration window before shutting down the computer or 
shutting down the service. If after hours the admin may have no choice but to 
let 4D server boot the clients off.

From what I gather from the responses, it really does not matter as for as 4D 
is concerned, it will “gracefully" quit any 4D client hanger ons before 
quitting no matter how it is told to quit. There should never be any damage to 
the data. 

Thanks to those who responded.

John



> On Aug 8, 2019, at 3:36 AM, Stephen J. Orth via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> John,
> 
> In our OEM system, which always runs as a service on Windows, we created an 
> Administrative function specifically designed to shutdown the Server.  This 
> walks the Admin through a series of "checks" just to be sure they want to 
> shut down, and how long they want to provide users.  Once they accept this, 
> we log it into the database and then execute a method on the Server using the 
> QUIT 4D command.
> 
> Hope that helps...
> 
> Best,
> 
> 
> Steve
> 
> *
>  Stephen J. Orth
>  The Aquila Group, Inc.  Office:  (608) 834-9213
>  P.O. Box 690   Mobile:  (608) 347-6447
>  Sun Prairie, WI 53590
> 
>  E-Mail:  s.o...@the-aquila-group.com
> *
>>> On Aug 8, 2019, at 01:14, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> 
>>> wrote:
>>> 
>>> What is the best practice for shutting down a windows computer when 4D 
>>> Server is running as a service?
>>> 
>>> I have been opening the administration window too see if there are any 
>>> users connected. If so, I have been disconnecting them before shutting down 
>>> the computer.
>>> 
>>> Just shutting down the computer seems to work as well, but what does 4D 
>>> server do in this case?
>>> 
>>> Thanks,
>>> 
>>> John
>>> 
>>> 
>>> 
>>> John Baughman
>>> Kailua, Hawaii
>>> (808) 262-0328
>>> john...@hawaii.rr.com
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: save listbox

2019-08-13 Thread JOHN BAUGHMAN via 4D_Tech
Responded earlier but don’t think my post made it to the NUG…

Store the arrays into an object, either a 4D object or ObjectTools object, then 
save the object to field or file.

I have a couple of methods that do just that, either native or OT. I will be 
happy to share them with you if you contact me directly. 


Here are the calls to save and retrieve the arrays  using my native object 
method…

//Save the arrays to a field
//assuming this thee arrays aFiles, aDistrict, and aFilesImported exist 
in the listbox.
oFiles:=New object
OBSetGetVariables_Jut 
("Set";->oFiles;"aFiles";"aDistrict";"aFilesImported")
GetSaveConstants ("load")
[_Constants]Project_Imports:=oFiles
GetSaveConstants ("Save”)   

//Retrieve the arrays from the field
ARRAY TEXT(aFiles;0)
ARRAY TEXT(aDistrict;0)
ARRAY BOOLEAN(aFilesImported;0)
oFiles:=[_Constants]Project_Imports 
OBSetGetVariables_Jut 
("Get";->oFiles;"aFiles";"aDistrict";"aFilesImported”)

Here are the calls to save and retrieve the arrays usingmy ObjectTools method…

/Save the arrays to a field
C_BLOB($blob)   
$otObject:=OTPutGetVariables_Jut ("New")
OTPutGetVariables_Jut 
("Put";$otObject;"aFiles";"aDistrict";"aFilesImported")
OT ObjectToBLOB ($otObject;$blob)
[_Constants]Project_Imports:=$blob
OT Clear ($otObject)

//Retrieve the arrays from the field
ARRAY TEXT(aFiles;0)
ARRAY TEXT(aDistrict;0)
ARRAY BOOLEAN(aFilesImported;0)
$otObject:=OTPutGetVariables_Jut ("New")
$blob:=[_Constants]Project_Imports
$otObject:=OT BLOBToObject ($blob)
OTPutGetVariables_Jut 
("Get";$otObject;"aFiles";"aDistrict";"aFilesImported")
OT Clear ($Object)

John


John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

> On Aug 13, 2019, at 11:29 AM, Peter Mew via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi
> Does anyone have a routine, component, plugin, or pointer to the right
> direction, that will save the contents of an array based listbox, so that
> the data can be restored at a later date
> thanks
> -pm
> 4d v13
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: PICTs

2019-08-19 Thread JOHN BAUGHMAN via 4D_Tech
Easiest way is to open the structure or a copy of the structure with v16 and 
run a verify in the MSC on the structure. All the images in the library as well 
as static images on forms will be listed as warnings if they are in PIC format.

John


John Baughman
Kailua, Hawaii 
(808) 262-0328
john...@hawaii.rr.com

> On Aug 19, 2019, at 11:33 AM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> In v13, or v15 is there a way to tell is a picture in the library is in 
> PICT, or other format?
> 
> Thanks
> Chip
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: windows versions for 4D v13.6

2019-08-30 Thread JOHN BAUGHMAN via 4D_Tech
If I understand your question…

Windows 10 - v17R5 64bit
Windows 2008 R2 Enterprise - v16 R6 64bit

John


> On Aug 30, 2019, at 10:31 AM, Chuck Miller via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Is anyone running server on OS newer than windows server 2003. If so what 
> version
> 
> 
> Regards
> 
> Chuck
> 
> Chuck Miller Voice: (617) 739-0306
> Informed Solutions, Inc. Fax: (617) 232-1064   
> mailto:cjmillerinformed-solutions.com 
> Brookline, MA 02446 USA Registered 4D Developer
>   Providers of 4D and Sybase connectivity
>  http://www.informed-solutions.com  
> 
> This message and any attached documents contain information which may be 
> confidential, subject to privilege or exempt from disclosure under applicable 
> law.  These materials are intended only for the use of the intended 
> recipient. If you are not the intended recipient of this transmission, you 
> are hereby notified that any distribution, disclosure, printing, copying, 
> storage, modification or the taking of any action in reliance upon this 
> transmission is strictly prohibited.  Delivery of this message to any person 
> other than the intended recipient shall not compromise or waive such 
> confidentiality, privilege or exemption from disclosure as to this 
> communication. 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Cache flushing did not complete... best practice

2019-10-23 Thread JOHN BAUGHMAN via 4D_Tech
What is the best way to recover from a a flushing that did not complete. I have 
never had an issue using restore before when this happened, but on my 
development machine I cannot get the data file to open again no matter what I 
try.

I do not care if data is missing so I have tried to delete all the indexes and 
journal, then use a datafile from a time machine backup from before the 
problem. I still cannot open the datafile.

John


John Baughman
Kailua, Hawaii  96734
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Cache flushing did not complete... best practice

2019-10-23 Thread JOHN BAUGHMAN via 4D_Tech
I have never had any trouble recovering until this version of 4D (v17R3).

> On Oct 23, 2019, at 9:09 AM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> When 4D starts flushing the cache to disk it writes something to the data 
> file on disk that it is flushing. When the flush finishes it removes this 
> marker inside the data file. 
> 
> When 4D starts up it checks for this marker and if found it knows 4D crashed 
> before completing the flush. Hence, the message you are seeing. 

Are you sure the marker is stored in the data file? If I restore a backup from 
Time Machine that I know was good and verify the records in the MSC, the verify 
fails saying the last database flush did not complete. I would think that the 
marker is stored someplace else. 

If I run a repair on the datafile 4D crashes. I have tried to run the repair 
several times and it crashes at the same spot every time.

I ran a repair on the structure and it failed reporting that the flush did not 
complete.

Finally I ran a repair on the datafile using record headers and it looks like I 
am back in. Just waiting on reindexing to finish.

For my clarification, can you confirm where the database is marked indicating 
that a flush is not complete. 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Cache flushing did not complete... best practice

2019-10-25 Thread JOHN BAUGHMAN via 4D_Tech
> On Oct 25, 2019, at 6:40 AM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> John was using a Time Machine backup and not a 4D backup, which is a 
> completely different type of backup and one that cannot be totally trusted 
> like you can with a 4D backup. Time Machine could have been copying the data 
> file at the exact time a flush was happening and not pick up every data file 
> change.

Tim, a minor correction. When I did my first “recover from backup”, I used the 
4D backup associated with the current datafile and journal. Only after I found 
that after the recover from backup that the datafile still reported an 
incomplete flush did I turn to my time machine backups. Even with the time 
machine backups, I restored earlier 4D backups from time machine and attempted 
the 4D recover from backup without any success. No matter how far I went back I 
still could not get it to recover properly.

John
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D v17 To QuickBooks Using Miyako's QBO.4DB

2019-12-13 Thread JOHN BAUGHMAN via 4D_Tech
Ken,

I have a deployed 4D database talking to QB on Windows 10 and 4D17r5. 
It started  out using Myles’ plug in. For me I had to stop using the plug in 
when the client moved to Windows 7.

I was able to get it done using…

 QB RDS client and server: Client or Client/Server needed or not at all 
depending on where Quickbooks is located on the network in relation to the 
requesting 4D Client or requesting 4D Server.

Windows PowerShell: 4D creates the QB request with the help of Myles’ 
XML methods. It then packs it into a PowerShelll script. The script is saved to 
a script fil. Launch External Process is used to launch PowerShell to read the 
script file. PowerSell creates the QBXMLRP com object and sends the request. 
The response is written out to as file on the hard drive which is read by 4D.

This has worked quite well over the years. When the client moved to 
Windows 10 I needed to do a bit of massaging but got it to work.  

Each time I revisit this project, it takes me a while to get my head 
around it all, but if you have any questions feel free to contact me off line. 
I will do my best… I am a MAC guy so my brain really needs a refresher each 
time I have to deal with Windows.

John

> On Dec 13, 2019, at 9:47 AM, Ken Eyring via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I have been using QBManager from Myles Wakeham up until now with version 
> 15.4, but it will not work with v17.
> 
> I found this link (https://github.com/miyako/4d-tips-quickbook-integration) 
> from the post (below) from Miyako in 2017 regarding integration to QuickBooks.
> 
> I've downloaded the database, but the code does not look familiar to 
> QBManager in any way.
> 
> I'm not sure how to use Miyako's plugin to open a connection to QuickBooks 
> and then subsequently send and retrieve data and then close the connection.
> 
> The QBManager plugin uses QBXML to do all of this.  I'm wondering if I need 
> to re-write all of the code to use Miyako's plugin, or if some/most of it can 
> be reused.
> 
> Is there any documentation or examples for Miyako's plugin that anyone is 
> aware of and would be willing to share?
> 
> Thank you,
> Ken Eyring
> 
> 
> 
> 
> 
> On 09/05/17 20:26 PM, Keisuke Miyako via 4D_Tech wrote:
>> you could start from here:
>> https://github.com/miyako/4d-tips-quickbook-integration
>>> 2017/09/06 8:18、Douglas von Roeder via 4D_Tech <4d_tech@lists.4d.com> のメール:
>>> What's the best approach to take for that.
>> **
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: http://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D v17 To QuickBooks Using Miyako's QBO.4DB

2019-12-16 Thread JOHN BAUGHMAN via 4D_Tech
Seeing an interest in 4D to Quickbooks desktop I am tempted to try my hand at 
writing a component that facilitates sending and receiving data between 4D and 
QuickBooks.

The 4D side of things is not that difficult using the Quickbooks SDK. What is 
challenging is the considerations and components needed outside of 4D…

QuickBooks: Where is it installed in relation to 4D Server and any 4D 
clients requiring access.
 Integrated Applications in QB Preferences
 
QB RDS Server: Is it needed and if so where is it installed?. Depends 
on where QuickBooks is installed and whether 4D Server or Client will be making 
the requests.

QB RDS Client: Is it needed and if so where is it installed?. Depends 
on where QuickBooks is installed and whether 4D Server or Client will be making 
the requests.

QBXMLRP.dll: only available in a 32bit version. QBXLMRP2.dll is also 
available also 32bit only. Which one to use,

Windows PowerShell: This is what I use to create the COM object to send 
to QuickBooks via the QBXMLRP dll. Must use the 32 bit version of PowerShell 
because the dll is 32 bit only. On a 64bit machine a 64bit app cannot call a 
32bit app or dll.

So a component will only help with part of the exercise. I will take a look at 
putting a component together. Perhaps it will be of use to somebody out there.

John


> On Dec 16, 2019, at 11:04 AM, David Loeppky via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Sharing data between QB's desktop and 4D is something we have been doing
> for about 10 years.  And something we have looked at alternative and better
> solutions for.
> 
> I'd assume like many companies, we try to use 4D for everything to run our
> business (our entire CRM / ERP / TIME CLOCK system) except accounting, and
> we use QB's for that.
> 
> CURRENT STATE:
> For the data we move out of QB's into 4D, we have created custom reports in
> QB's that include the data we want to export.  We run this report and save
> the results as a .csv file into a shared folder with our 4D Server.  A 4D
> Server routine checks this folder ever couple minutes and if it finds a
> file, an import routine runs to pull the data into 4D and then archives the
> .csv.  As for the data shared key, we use a custom fields available in
> Quickbooks to manually added the 4D ID to the QB's custom field.  This
> custom field data is part of the custom export report.  We only add a new
> customer to Quickbooks a couple of times a month, so this is not too
> onerous to manually keep up to date.
> 
> For data coming from 4D into QB's, we have a custom report that runs in 4D
> and outputs a file into a shared folder.  We use a 3rd party software
> (certified by QB's) called Transaction Pro (https://www.transactionpro.com/)
> that we have configured to import this data into QB's.  This is done in one
> or two batches per day.
> 
> 
> FUTURE STATE:
> We currently have a project underway to use QODBC (https://qodbc.com/), to
> have the data exchange happening automatically using SQL over ODBC directly
> between QBs and our 4D server.  This is no faint of heart project!  QB's
> tables are complex and there are lots of rules that need to be adhered to.
> The help files and examples from QODBC are plentiful and helpful. We are
> hopefully a couple of weeks away from completion.  Please contact me if you
> would like me to share more on how this has progressed.
> 
> I'd welcome learning how others are addressing this.  Thanks,
> 
> David Loeppky
> Chuckanut Bay Foods
> dav...@chuckanutbay.com
> 
> 
> 
> 
> 
> -- 
> 
> Regards,
> 
> David Loeppky
> 
> Co-Owner
> 
> T: 360.380.1908 x111
> 
> M: 360.319.9141
> 
> F: 360.384.3673
> 
> *dav...@chuckanutbay.com *
> 
> 
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: running server v17.3 as a service

2019-12-30 Thread JOHN BAUGHMAN via 4D_Tech
I have been running 4D server as a service for about a year now and have had no 
problems except for a single instance of the service stopping unexpectedly. 
Don’t know if it was 4D crashing or the service itself stopping, 

When I was setting this up I remember finding a way to access the service user 
interface.. I think this explains what I was trying to do.,,

  https://docs.microsoft.com/en-us/windows/win32/services/interactive-services 


I got it to work on my development machine but for some reason could not get it 
working on the deployed server.

John


> On Dec 30, 2019, at 1:49 PM, Charles Miller via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Thh hi a is that helps a lot. When trying to enable the interact with
> desktop on server 2026. You can see alerts but can not do anything about
> them. I am making program changes but how might one handle an unexpected
> Alert
> 
> Regards and happy holidays
> 
> Chuck
> On Mon, Dec 30, 2019 at 6:43 PM Keisuke Miyako via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> the documentation points you in the right direction
>> 
>> 
>> https://doc.4d.com/4Dv17/4D/17.3/Registering-a-Database-as-a-Service.300-4640983.en.html
>> 
>> read carefully the passage on “Local System Account” and printing.
>> 
>>> 2019/12/30 22:35、Chuck Miller via 4D_Tech <4d_tech@lists.4d.com>のメール:
>>> How to implement and what pitfalls or gotchas there might be.
>>> I will be using a built server, with a data file outside of the package
>> folder
>> 
>> 
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> -- 
> -
> Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
> Informed Solutions, Inc.
> Brookline, MA 02446 USA Registered 4D Developer
>   Providers of 4D, Sybase & SQL Server connectivity
>  https://www.informed-solutions.com
> -
> This message and any attached documents contain information which may be
> confidential, subject to privilege or exempt from disclosure under
> applicable law.  These materials are intended only for the use of the
> intended recipient. If you are not the intended recipient of this
> transmission, you are hereby notified that any distribution, disclosure,
> printing, copying, storage, modification or the taking of any action in
> reliance upon this transmission is strictly prohibited.  Delivery of this
> message to any person other than the intended recipient shall not
> compromise or waive such confidentiality, privilege or exemption from
> disclosure as to this communication.
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Printing List Box v16R5

2020-03-01 Thread JOHN BAUGHMAN via 4D_Tech
4dI have done this many times before but for this particular listbox I am 
getting a blank page using…

PRINT SETTINGS  
If (ok=1)
OPEN PRINTING JOB
FORM LOAD("DistrictPromotions")
$end:=False
Repeat 
$end:=Print object(*;”Statistics")
Until ($end)

CLOSE PRINTING JOB

End if 

The List Box is array based.

What am I missing?

Thanks,

John


John Baughman
Kailua, Hawaii 
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Printing List Box v16R5 - never mind

2020-03-01 Thread JOHN BAUGHMAN via 4D_Tech

I forgot that I needed to set the x, y start positions otherwise it prints 
based on the position of the list box on the form, which would push it off the 
page.

John


> On Mar 1, 2020, at 2:37 PM, JOHN BAUGHMAN  wrote:
> 
> 4dI have done this many times before but for this particular listbox I am 
> getting a blank page using…
> 
>   PRINT SETTINGS  
>   If (ok=1)
>   OPEN PRINTING JOB
>   FORM LOAD("DistrictPromotions")
>   $end:=False
>   Repeat 
>   $end:=Print object(*;”Statistics")
>   Until ($end)
> 
>   CLOSE PRINTING JOB
> 
>   End if 
> 
> The List Box is array based.
> 
> What am I missing?
> 
> Thanks,
> 
> John
> 
> 
> John Baughman
> Kailua, Hawaii 
> (808) 262-0328
> john...@hawaii.rr.com
> 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Receive packet stop character

2020-03-25 Thread JOHN BAUGHMAN via 4D_Tech
I have a tab delimited text file and I want to get the first row with…

C_TEXT($TextValue)
$DocRef:=Open document($IndexPath)
RECEIVE PACKET($DocRef;$TextValue;”\r")
CLOSE DOCUMENT($DocRef)

This was working fine until about an hour ago when it suddenly started bringing 
in the whole document which has many rows. Using “\t” works fine just bringing 
the first field in the first row.
Any ideas?

Mac OS High Sierra
4D v14 in Unicode mode

John


John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Receive packet stop character

2020-03-25 Thread JOHN BAUGHMAN via 4D_Tech

> On Mar 25, 2020, at 4:46 PM, Charles Miller via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Perhaps it is a new line

Trying to figure out what was wrong I went into the text file with TextEdit and 
deleted each return making sure that there was no other hidden characters in 
there and reinserted the return with the return key. I also opened it up in 
Pages and showing invisibles all were carriage returns I also brought in other 
text files that have worked fine up to now and it did not work with them either.


> 
> On Wed, Mar 25, 2020 at 9:31 PM JOHN BAUGHMAN via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> I have a tab delimited text file and I want to get the first row with…
>> 
>> C_TEXT($TextValue)
>> $DocRef:=Open document($IndexPath)
>> RECEIVE PACKET($DocRef;$TextValue;”\r")
>> CLOSE DOCUMENT($DocRef)
>> 
>> This was working fine until about an hour ago when it suddenly started
>> bringing in the whole document which has many rows. Using “\t” works fine
>> just bringing the first field in the first row.
>> Any ideas?
>> 
>> Mac OS High Sierra
>> 4D v14 in Unicode mode
>> 
>> John
>> 
>> 
>> John Baughman
>> Kailua, Hawaii
>> (808) 262-0328
>> john...@hawaii.rr.com
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> -- 
> -
> Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
> Informed Solutions, Inc.
> Brookline, MA 02446 USA Registered 4D Developer
>   Providers of 4D, Sybase & SQL Server connectivity
>  https://www.informed-solutions.com
> -
> This message and any attached documents contain information which may be
> confidential, subject to privilege or exempt from disclosure under
> applicable law.  These materials are intended only for the use of the
> intended recipient. If you are not the intended recipient of this
> transmission, you are hereby notified that any distribution, disclosure,
> printing, copying, storage, modification or the taking of any action in
> reliance upon this transmission is strictly prohibited.  Delivery of this
> message to any person other than the intended recipient shall not
> compromise or waive such confidentiality, privilege or exemption from
> disclosure as to this communication.
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Receive packet stop character

2020-03-25 Thread JOHN BAUGHMAN via 4D_Tech
> On Mar 25, 2020, at 3:54 PM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> You've got a smart quote in there... email post typo or is it in your code?

Actually I typed that in while drafting the email. This is old code 
that has worked for years. I also tried changing the code to char(carriage 
return)

> Could the line ending have change to something else like \n ?

No. See my response to Chuck.

John


> 
>> On Mar 25, 2020, at 9:31 PM, JOHN BAUGHMAN via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> I have a tab delimited text file and I want to get the first row with…
>> 
>> C_TEXT($TextValue)
>> $DocRef:=Open document($IndexPath)
>> RECEIVE PACKET($DocRef;$TextValue;”\r")
>> CLOSE DOCUMENT($DocRef)
>> 
>> This was working fine until about an hour ago when it suddenly started 
>> bringing in the whole document which has many rows. Using “\t” works fine 
>> just bringing the first field in the first row.
>> Any ideas?
>> 
>> Mac OS High Sierra
>> 4D v14 in Unicode mode
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Receive packet stop character

2020-03-25 Thread JOHN BAUGHMAN via 4D_Tech
Thanks to all who responded. I am really confused now. Turns out the problem 
was in fact what I suspected all along… the end of row delimiter was a line 
feed and not a carriage return. 

This begs a few questions …

Why did this change all of a sudden. I had been working with the same 
text document for most of the day and it was working fine. This is an old 
project and I have never had an issue with this particular section of cade 
before.

On a Mac doesn’t TextEdit use carriage returns? It has always done so 
for me in the past. If I hit the return key on my keyboard it should be a 
carriage return. As soon as I saw this problem earlier today, I re-typed all 
the paragraph endings with a return using the return key on my keyboard in 
TextEdit. In the past if there was a line feed in the document it always showed 
up as a blank character. In other words, back space the carriage return and you 
had to backspace one more time to get to the end of the paragraph.

No need to respond. I knew what the problem most likely was before I 
sent my first message. Thanks to Spencer Hinsdale for suggesting to use USE 
CHARACTER SET("iso-8859-1";1). It revealed the \n in the returned package. 
Otherwise I would have continued to chase my tail on this one.

John




>> On Mar 25, 2020, at 8:10 PM, Spencer Hinsdale via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> 
>> Does the behavior change if you insert
>> USE CHARACTER SET("iso-8859-1";1)
>> before receive packet
>> 
>> 
>> On 3/25/20, 8:01 PM, "4D_Tech on behalf of JOHN BAUGHMAN via 4D_Tech" 
>> <4d_tech-boun...@lists.4d.com on behalf of 4d_tech@lists.4d.com> wrote:
>> 
>>> On Mar 25, 2020, at 3:54 PM, Jeffrey Kain via 4D_Tech 
>>> <4d_tech@lists.4d.com> wrote:
>>> 
>>> You've got a smart quote in there... email post typo or is it in your code?
>> 
>>  Actually I typed that in while drafting the email. This is old code 
>> that has worked for years. I also tried changing the code to char(carriage 
>> return)
>> 
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> _
> Bob McKeever  http://www.mswl.com <http://www.mswl.com/>
> McKeever's Software Wizardry
> Port Coquitlam, B.C.
> bobmckee...@mac.com
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Dll error help

2020-03-28 Thread JOHN BAUGHMAN via 4D_Tech
I am trying to get a v14 database to work on windows uncompiled and on startup 
I am getting…

The ordinal 748 could not be located in the dynamic link library 
ASINTPPC.dll

If I click ok to the error window, database startup, but the constants in the 
Foundation Extras.bundle in the Plugins folder throws a “License or privilege” 
error (-9949). Do not know if the 2 are related.

Any help would be appreciated.

Thanks

John
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

All plugins are throwing a License or privilege error on windows. Was: Dll error help

2020-03-29 Thread JOHN BAUGHMAN via 4D_Tech
This is an old database v12 that I am trying to upgrade to v16 and later. I had 
upgraded it to v14 on a Mac, but when I moved it to Windows Server 2008 I got 
the dll error that started this thread and as noted that foundation’s Extras 
plugin was throwing a license or privilege error. 

Walt... it is Foundation 3. I would upgrade it but do not have the luxury of 
time in this particular case to go that route at the moment.

I Decided to move on to v16 and see what happens, Lo and behold, the dll error 
went away, but the Extras plugin continued throw errors and I have since 
realized that this was the case for all the plugins in the plugin folder. The 
plugins are in fact being loaded as they are recognized (tokenized) in the 
design environment. The error is thrown when any plugin command is called.

I do have a working built application (v12) with the same plugins installed and 
they work fine there. I copied the plugins from the built application on the 
same windows machine to my upgraded version with the same result. 

Being that 4D does recognize the plugin commands, I think this has something to 
do with the OS security settings for the plugins folder and it’s contents. 
Currently System, Administrators and Users all have Full control are set for 
the Plugins folder and all of it’s content..

Any ideas?

All my windows work is being done in VirtualBox VMs.

Thanks,

John

> On Mar 28, 2020, at 10:04 AM, Walt Nelson  <mailto:walt.nel...@gmail.com>> wrote:
> 
> John,
> 
> Which version of Foundation Shell are you using?
> 
> Foundation 5 or later does not require Foundation Extras.bundle anymore.
> 
> Thanks,
> Walt
> 
> 
>> On Mar 28, 2020, at 2:39 AM, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com 
>> <mailto:4d_tech@lists.4d.com>> wrote:
>> 
>> If I click ok to the error window, database startup, but the constants in 
>> the Foundation Extras.bundle in the Plugins folder throws a “License or 
>> privilege” error (-9949). Do not know if the 2 are related.
>> 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Multiple instances of 4D Client

2020-04-17 Thread JOHN BAUGHMAN via 4D_Tech
I don’t think you have to create duplicate copies of 4D. I an not on Windows 
but have a client who is on Windows 10 and he is able to have multiple 
instances of the same 4D client running at the same time on the same machine, 
each connected to different 4D servers.

John



> On Apr 2, 2020, at 1:57 PM, Kevin Abraham via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Don’t tell me Windows 10 for 4Dv16.2 has broken this but it is incredibly 
> easy and we have been doing this with up to 4 Servers since v6 all the way to 
> v13, so I would be very surprised if this ability was changed by Window or 4D.
> 
> Simply go find your 4D Installation, in my case 4D v13.3 in Program Files 
> (x86). Then make as many copies of that 4D folder as you need, in your case 1 
> and in my case 4. They will be named 4D v13.3 - Copy, Copy(2), etc. by 
> windows when you create them in Program Files. Then simply create a shortcut 
> to each 4D.exe and put them on the desktop. If you have 4 installed copies of 
> 4D you will have 4 Shorcuts to 4 different 4D.exe files and can connect to up 
> to 4 different Servers at the same time.
> 
> Now what you can’t do, is connect any more than one of them to a single 
> Server at the same time, i.e. you can not have 2 Clients connected to the 
> same server at the same time (at least not the way I described above, maybe 
> someone knows how, but not me).
> 
> Good Luck,
> Kevin Abraham
> Digital Retirement Solutions
> kabra...@drs401k.com
> 
>> On Apr 2, 2020, at 1:13 PM, Ken Geiger Gmail via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> Hi all,
>> 
>> Dumb question. I have a customer with two 4D C/S databases that are running 
>> simultaneously on two instances of 4D Server. He would like to launch two 
>> instances of 4D Client on his workstation so he dies not have to keep 
>> quitting and launching the Client to access either of his apps. Windows 10, 
>> 4D 16.2. 
>> 
>> Regards,
>> 
>> Ken Geiger
>> 
>> Sent from my iPhone
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Multiple instances of 4D Client

2020-04-17 Thread JOHN BAUGHMAN via 4D_Tech
Forgot to mention he is on 4D v18.

> On Apr 17, 2020, at 11:36 AM, JOHN BAUGHMAN  wrote:
> 
> I don’t think you have to create duplicate copies of 4D. I an not on Windows 
> but have a client who is on Windows 10 and he is able to have multiple 
> instances of the same 4D client running at the same time on the same machine, 
> each connected to different 4D servers.
> 
> John
> 
> 
> 
>> On Apr 2, 2020, at 1:57 PM, Kevin Abraham via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> Don’t tell me Windows 10 for 4Dv16.2 has broken this but it is incredibly 
>> easy and we have been doing this with up to 4 Servers since v6 all the way 
>> to v13, so I would be very surprised if this ability was changed by Window 
>> or 4D.
>> 
>> Simply go find your 4D Installation, in my case 4D v13.3 in Program Files 
>> (x86). Then make as many copies of that 4D folder as you need, in your case 
>> 1 and in my case 4. They will be named 4D v13.3 - Copy, Copy(2), etc. by 
>> windows when you create them in Program Files. Then simply create a shortcut 
>> to each 4D.exe and put them on the desktop. If you have 4 installed copies 
>> of 4D you will have 4 Shorcuts to 4 different 4D.exe files and can connect 
>> to up to 4 different Servers at the same time.
>> 
>> Now what you can’t do, is connect any more than one of them to a single 
>> Server at the same time, i.e. you can not have 2 Clients connected to the 
>> same server at the same time (at least not the way I described above, maybe 
>> someone knows how, but not me).
>> 
>> Good Luck,
>> Kevin Abraham
>> Digital Retirement Solutions
>> kabra...@drs401k.com
>> 
>>> On Apr 2, 2020, at 1:13 PM, Ken Geiger Gmail via 4D_Tech 
>>> <4d_tech@lists.4d.com> wrote:
>>> 
>>> Hi all,
>>> 
>>> Dumb question. I have a customer with two 4D C/S databases that are running 
>>> simultaneously on two instances of 4D Server. He would like to launch two 
>>> instances of 4D Client on his workstation so he dies not have to keep 
>>> quitting and launching the Client to access either of his apps. Windows 10, 
>>> 4D 16.2. 
>>> 
>>> Regards,
>>> 
>>> Ken Geiger
>>> 
>>> Sent from my iPhone
>>> **
>>> 4D Internet Users Group (4D iNUG)
>>> Archive:  http://lists.4d.com/archives.html
>>> Options: https://lists.4d.com/mailman/options/4d_tech
>>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>>> **
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Select folder

2020-04-22 Thread JOHN BAUGHMAN via 4D_Tech
On Windows when using Select Folder only folders are displayed. Is there any 
way to get documents to be listed as well. On a Mac documents are listed but 
cannot be selected. Is this a Windows thing or a 4D thing?

John


John Baughman
1331 Auwaiku Street
Kailua, Hawaii  96734
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Using Document to text ala Receive Packet Was: Receive packet stop character

2020-04-23 Thread JOHN BAUGHMAN via 4D_Tech
> On Mar 25, 2020, at 8:21 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> sometimes, it might just be easier to read the entire text with
> 
> Document to text (which can normalise the EOL character)

I took Keisuke’s advice to heart and looked closer at Document to text. I did 
not realize that it provided a means to handle any EOL confusion between Mac 
and Windows. For me this makes the use of Document to text a much better way to 
read the contents of a document by row than Receive packet. 

 In an effort to duplicate Receive packet’s functionality when used in a repeat 
loop to get rows of a tab delimited text document, I created a wrapper method 
as a replacement for Receive packet.

I am posting this method here in the event someone on on the NUG might find it 
useful. More importantly for me, however, perhaps to get some feedback with 
regard to anything I may have overlooked or anything I may need to do to clean 
it up.

It was written in a v14 database so does not use any of the newer features in 
v17 and later like Is Windows and/or objects.

 Thanks for any feedback.

John


--

  // Method: ReceivePacket_DocToText 
(->pathToDocumentVariable;->VariableToHoldDocContents;BreakMode)
  // 
  // Created by: John Baughman
  // 
  // Description
  //Replacement for Receive Packet using Document To Text

  // Parameters
C_POINTER($1;$pathPtr)  //$1 is a pointer to the variable holding the path to 
the document. 
  //In a repeat loop you can put an empty string in the variable to allow the 
user to pick the document using Document Select.
  //The variable will be updated to contain the chosen path for subsequent 
calls for rows in the loop. 
  //If the user cancels the Select Document, $rowText:="", and 
$documentTextPtr->:=“"

C_POINTER($2;$documentTextPtr)  //Pass an empty text variable in the first call 
and it will be loaded from the document with Document to text.
  //The variable will be loaded with the document contents minus the row being 
returned.

C_TEXT($0;$rowText)  //$RowText will hold the first row in the $DocumentTextPtr 
variable and returned in $0. 
  //The first row in the $DocumentTextPtr variable wil be removed.

C_LONGINT($3;$breakMode)  //Document to Text will convert the EOL character to 
the following desired break mode constants...
  //Document with CR
  //Document with CRLF
  //Document with LF
  //Document with native format

  //Example Call
If (False)
  C_TEXT($TextValue;$path)
  $TextValue:=""
  $path:=""
  Repeat 
$rowText:=ReceivePacket_DocToText (->$path;->$TextValue;Document with CR)
 //If TextValue is “” then the text will be loaded from the document 
and returned minus the first row in TextValue
 //Subsequent calls will return first row in $rowText and return the 
text minus the first row in TextValue.
  If (rowText#””)
 //handle the row
  End if
  Until (TextValue =“")   //note: I do not use the ok variable as I found that 
the ok variable may get set incorrectly by 4D if the last row does not have CR.

End if 

  // 

$pathPtr:=$1
$DocumentTextPtr:=$2
$breakMode:=$3
$rowText:=""

If ($pathPtr->="")
  //They want to select the document
ARRAY TEXT($aSelected;0)
$path:=Select document("";"*";"";0;$aSelected)

If (ok=1)
$pathPtr->:=$aSelected{1}

End if 

End if 

If (ok=1)

If ($DocumentTextPtr->="")
  //Document has not yet been loaded
If (Is Windows)
$documentTextPtr->:=Document to 
text($pathPtr->;"ANSI_X3.4-1986";$breakMode)
$stopCharacter:="\r\n"

Else 
$documentTextPtr->:=Document to 
text($pathPtr->;"MacRoman";$breakMode)
$stopCharacter:="\r"

End if 

   //else document has been loaded use text in DocumentTextPtr

End if 

$found:=False

Case of 

: ($breakMode=Document with CR)
$stopCharacter:="\r"

: ($breakMode=Document with LF)
$stopCharacter:="\n"

: ($breakMode=Document with CRLF)
$stopCharacter:="\r\n"

  //else
  //$stopCharacter was set to the default for the 
platform above following document to text

End case 


If (Position($stopCharacter;$DocumentTextPtr->)=0)
  //Assumes that this is the last row without an EOL

Re: Using Document to text ala Receive Packet Was: Receive packet stop character

2020-04-24 Thread JOHN BAUGHMAN via 4D_Tech
I have modified my Document to text wrapper that functions like Receive packet. 
Not sure if anyone is really interested in this but since I did post the 
original method I thought it best for me to post the modified version.

The new version has 2 uses..

1. To replace Receive packet as it was used in a loop to receive the 
contents of a document 1 row at a time.
2. To load the contents of a document with a specified EOL character 
regardless of platform, with or without an existing header row

Also changed is the requirement to pass the break mode parameter (EOL) when 
using as a replacement for Receive Packet. Only the first 2 parameters are now 
passed.

I hope someone finds this useful.

John

 // Method: ReceivePacket_DocToText 
(->pathToDocumentVariable;->VariableToHoldDocContents{;BreakMode}{;RemoveTopRows})->
 rowText | {header text | document text}
  // 
  // Created by: John Baughman
  // Date and time: 34/23/20,  1:05 PM
  // 
  // Description
  //   Replacement for Receive Packet using Document To Text
  // Parameters
C_POINTER($1;$pathPtr)  //$1 is a pointer to the variable holding the path to 
the document. 
  //In a repeat loop you can put an empty string in the variable to allow the 
user to pick the document using Document Select.
  //The variable will be updated to contain the chosen path which will prevent 
the document from being loaded again 
  //If the user cancels the Select Document, $rowText:="", and 
$documentTextPtr->:=""
C_POINTER($2;$documentTextPtr)  //Pass an empty text variable in the first call 
and it will be loaded from the document with Document to text.
  //subsequent calls will not reload the document as the variable will no 
longer be empty. Instead the wrapper will use this variable as passed in ($2)
  //The variable will be loaded with the document contents minus the row being 
returned.
C_TEXT($0;$rowText)  //$RowText will hold the first row in the $DocumentTextPtr 
variable and returned in $0. 
  //The first row in the $DocumentTextPtr variable wil be removed.
  //If you pass more than 2 parameters $0 will be the document contents or 
removed top rows as explained in the following parameters

  //The following parameters are used only if you just want the contents of the 
document. DO NOT USE IN A LOOP
C_LONGINT($3;$breakMode)  //Document to Text will convert the EOL character in 
the document to the passed desired break mode constants...
  //Document with CR
  //Document with CRLF
  //Document with LF
  //Document with native format
C_LONGINT($4;$removeTopRowscount)  //The number of top rows to be removed from 
the returned contents. 
  //The document contents with or without top rows removed will be returned in 
the $documentTextPtr variable ($2)
  //The removed lines will be returned in $0
  //If you want the whole document pass 0 in $4. In the case both $0 and the 
$documentTextPtr variable ($2) will contain the whole document
  //The EOL character(s) will be the requested characters as passed in $3


If (False)  //Example Calls
//With regard to EOL characters, the following examples will work on 
both Mac and Windows platforms

  //---
  //To replace Recieve Packet getting each row one at a time in a loop
C_TEXT($TextValue;$path)
$TextValue:=""
$path:=""
Repeat 
$row:=ReceivePacket_DocToText (->$path;->$TextValue)
  //handle the row
Until (ok=0)


  //---
  //To get the whole document contents with CRs as the EOL characters
C_TEXT($TextValue;$path)
$DocumentText:=""
$path:=""
$DocumentText:=ReceivePacket_DocToText 
(->$path;->$DocumentText;Document with CR;0)  //Get the whole document
  //$DocumentText = whole document with CRs including a header row if 
it exists
  //Note: In this context $2 can be a nill pointer

  //---
  //To get the document contents WITHOUT the header row, with CRs as 
the EOL characters
C_TEXT($TextValue;$path)
$DocumentText:=""
$path:=""
$removedRows:=ReceivePacket_DocToText (->$path;->$DocumentText;Document 
with CR;1)  //Get the whole document without the header row. To remove 1 top 
rows, pass 1, for 2 rows pass 2, etc.
  //$romovedRows is the header row and $DocumentText contains the 
document content without the header row, both with CRs

End if 



  // 

$pathPtr:=$1
$DocumentTextPtr:=$2


If (Is nil pointer($2))
$documentText:=""
$DocumentTextPtr:=->$documentText

End if 



If (Count parameters=2)
$breakMode:=Document with CR //The wrapper will always use CR for 
Recieve packet functionality

Else 
//Document text with EOL characters is being requested
$breakMode:=$3
$remov

V18 QuickReport what am I missing

2020-04-25 Thread JOHN BAUGHMAN via 4D_Tech
I am looking at the Quick Report Editor in v18 for the firs time. It looks a 
lot less daunting for the end user which is a good thing. I have a couple of 
questions…

4D v18.1 LTS
Mac High Sierra

1. When I click the Sort popup in the popup associated with a column 
header I get a color list just as if I had click the color bucket next to it.

2. If you double click the grand total row in a column a control wheel 
pops up just above the field’s upper left corner, click the control wheel and a 
list of grand total options pops up. Select an option like Sum and nothing 
happens. If you Select Sum from the format control wheel in the lower right 
corner of the field you get the Sum icon. If you click this control wheel now 
in the upper left corner the Sum icon converts to ##s and is highlighted. Click 
the control wheel and select a different option like Average, nothing changes 
in the field.
  
3. If I execute with HTML  selected as the destination, I get a blank 
file. The docs says it will use “the default HTML template” and if I click 
Options and view I can see the default template. I selected the Default check 
box and I still get a blank file.

So far I have only looked at list reports.

 Perhaps these are bugs that have already been reported. The sorting 
problem severely reduces the usability of the new Quick Report Editor as you 
can not establish sub totals without being able to set the sorts.

John




John Baughman
Kailua, Hawaii
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: ListBoxes and AreaList Pro again (was: Object notation replacement for use of Self in a script — v18)

2020-05-04 Thread JOHN BAUGHMAN via 4D_Tech

First off, this is in no way an attempt to bash AreaList Pro. It is one 
of the best and most solid plugins available. Price is write and support 
continues to be great. If any plugin fits your needs by all means stick with 
it. Some of yoI have may remember that in the old days I always argued for the 
use of plugins. I still feel the same and will gladly argue for their use 
again. Replacement in favor of a built in 4D feature is a different story.

After many many solid years with AreaList Pro, however, I made the 
switch to 4D listboxes a couple of years ago.  I made the switch because I got 
tired of dealing with plugins in general when upgrading 4D over time. In most 
4D upgrades over the years making sure the plugins worked and were properly 
licensed has always been the biggest hurdle (the move to 64bit and 4D Write Pro 
are the most glaring examples of exceptions to the rule). 

Another reason I am prone to switch is that I find that debugging code 
that involves a plugin can be a real headache. Also it is far easier to force a 
crash when using a plugin vs a built in 4D feature.

To me plugins exist to fill gaps in 4D. When those gaps are filled in 
by 4D, it is time for me to consider abandoning the plugin that bridged the 
gap. AreaList Pro, PrintList Pro. ObjectTools, and DisplayLiat have all been 
victims of my evolved philosophy with regard to plugins. Having far fewer 
plugins today makes my programming life far less complicated than before. I’ve 
found that the effort to replace has definitley paid off for me in the end.

Referring to Philipp’s comments...

> It would be too bad (and very time consuming) to get rid of all your hard 
> work instead of just following AreaList Pro's evolution.

Actually I found the switch less painful than expected for all of these 
plugins. I always wrap plugin commands as much as I can as soon as I get them  
so that replacing code is an orderly and centralized process. Also I never 
touch the existing implantation of the plugin. I duplicate the methods and in 
the case of AreaList make the AreaList areas invisible and place the listbox on 
top of the ALPRo area. For other form objects that contain plugin code I like 
to put the object's code inside a case statement with both the plugin's code 
and the new 4D code in the same object. I don’t remove the plugin until I am 
sure that the replacement works as expected.  A day or 2 of work at most.

> The main ListBox features are basically AreaList Pro v6-7, IOW they (almost) 
> do what AreaList Pro did 20 years ago.

True, but that is no reason to keep using the plugin if 4D can do every 
thing you want now, be it 20 years later. If I later find a feature that I 
absolutely have to have and the only way is to use ALPro, put it back in the 
mix. So far I have not run into a subsequent need for a feature in a replaced 
plugin.

> 4 versions (and many years) later there is still no comparison between the 
> basic ListBoxes and the numerous features added by AreaList Pro v9 and v10. 
> To name a few: breaks, sub-totals/calculations, transposition, displaying 
> mySQL data, complete granularity up to cell level, event callbacks, area 
> templates (global default settings), multiple header rows, zoom, etc.

True again, but if you need any of those things the gap has not yet 
been filled… don’t replace. I you do not need any of those featrures nor expect 
to in the future… it may be time to replace.

> And the property-based syntax since version 9 makes it very easy to program.

For me I find it easier to program a listbox than an AreaListPro area, 
but I do agree that it is easy to program AreaList. 
> 
> Now the recent features of ListBoxes regarding object support are not yet 
> available in AreaList Pro, just because we have the same level of information 
> as everyone else here, so it take time to catch up. OTOH it provides the 
> distance to think twice about how it should be done, and collect requests 
> from informed developers.

Not an issue if you still have a need to continue to use AreaList. The 
beauty of AreaList is that when it does catch up it often does what ever was 
lacking better than 4D.
> 
> BTW these features often (and increasingly will) require a 4D View pro 
> license, much more expensive than AreaList Pro.

Good point. I only have one client where there was a need for View. The 
difference in maintenance to my client, however, was barely noticed. No cost 
increase for me.

My 2¢ worth. ;-)

John


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

<    1   2   3   4