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 Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted September 21, 2017 MVP 2023 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.. 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. Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted September 22, 2017 MVP 2023 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now