Fullstopp instead of comma

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Fullstopp instead of comma

Postby BKG » Sun Oct 02, 2022 3:02 pm

Someone who knows of a code to check/correct , to . ? is a bit scary to use the wrong type at Z ofsett
BKG
 
Posts: 53
Joined: Fri May 10, 2019 8:32 pm

Re: Fullstopp instead of comma

Postby dezsoe » Mon Oct 03, 2022 8:50 pm

You can use both: UCCNC will convert it.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Fullstopp instead of comma

Postby BKG » Tue Oct 04, 2022 12:28 am

dezsoe wrote:You can use both: UCCNC will convert it.

Not if it is in a Macro, then the Z ofsett is going crasy if "," is used

string stNominal = exec.TextQuestion("To probe from the Spoilboard surface, enter the nominal thickness of the material. Enter '0' or leave blank if probing from the material surface (mm)");
double Nominal = 0;
if(!(stNominal == ""))
{
Nominal = Convert.ToDouble(stNominal);
BKG
 
Posts: 53
Joined: Fri May 10, 2019 8:32 pm

Re: Fullstopp instead of comma

Postby dezsoe » Tue Oct 04, 2022 9:55 am

OK, I see. After you input the string try

Code: Select all
stNominal = stNominal.Replace(',', '.');

This will replace the commas with points.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Fullstopp instead of comma

Postby BKG » Tue Oct 04, 2022 1:51 pm

dezsoe wrote:OK, I see. After you input the string try

Code: Select all
stNominal = stNominal.Replace(',', '.');

This will replace the commas with points.


Thanks Dezoe, that fixed it :)
BKG
 
Posts: 53
Joined: Fri May 10, 2019 8:32 pm


Return to Macros

Who is online

Users browsing this forum: No registered users and 19 guests

cron