Cartier Posted September 21, 2017 Report Share Posted September 21, 2017 Hi all, I'm saving datas in a SD Card thanks to Visilogic. I've a problem with the file's name saved : I want its name to be the value in ML4-NumAffaires. For exemple it can be 83178. But instead of having this, I've -D-. I think it's a problem of space and conversion, but I don't manage to fix the problem. Thanks in advance for your help Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted September 21, 2017 MVP 2022 Report Share Posted September 21, 2017 The name will be a string that is the ASCII equivalent of the values 8 characters long. It does not do a literal translation of the decimal number. You will need to enter the values in hex. One byte is needed per character, so an ML can hold four characters. In your example, the name would be held in ML 4 and ML 5. I wouldn't have them power up to zero, as ASCII (0) is a null. The ASCII table is in the Unitronics Help and can also be found at asciitable.com. So for your example - 83178 - the ASCII characters needed in hex are 38 33 31 37 38 00 00 00. So ML 4 needs to contain 38333137h and ML5 needs 38000000h. I'll leave the rest to you as an exercise. Let us know what you come up with. Joe T.. Quote Link to comment Share on other sites More sharing options...
Cartier Posted September 22, 2017 Author Report Share Posted September 22, 2017 Hi Joe, Thanks a lot for your help. I fixed the problem by adding a num to ASCII translation as below. And the file's name is ML6. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted September 22, 2017 MVP 2022 Report Share Posted September 22, 2017 Exercise completed. Good job! A+ Thanks for posting your solution. You may want to note in your register descriptors that the filename will be contained in ML 6 AND ML 7 since you specified 8 characters. Joe T. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.