Home > Back-end >  In the Memo line extraction a G code in the X, Y, Z values in the result
In the Memo line extraction a G code in the X, Y, Z values in the result

Time:09-16

As title, can you tell me the procedure how to edit? G code for numerical control machine tool,
For example: G01 X30 Z30;
G01 X20 Z - 10;
Consider linear interpolation, better curve interpolation

CodePudding user response:

Const
.='MSVCRT MSVCRT DLL';

The function sscanf (buffer: PAnsiChar; Const format: PAnsiChar) : integer; Cdecl; Varargs. External MSVCRT;
The function swscanf (buffer: PChar; Const format: PChar) : integer; Cdecl; Varargs. External MSVCRT;//Delphi 2009 +

Procedure test.
Var
X, z: integer;
The begin
Swscanf (PChar (Memo1 Lines [0]), 'G01 X % d % d Z' @ X, @ Z);
//...
end;