Search found 14 matches
- Wed Feb 17, 2021 10:48 pm
- Forum: Technical
- Topic: Filtering keystrokes using FMX
- Replies: 6
- Views: 196
Re: Filtering keystrokes using FMX
I'm going to post an answer to my own question, and it appears it's actually pretty trivial. FMX has a property in Object Inspector called FilterChar that is built to handle this issue directly. Unfortunately it is almost not cross-referenced to the act of intercepting keystrokes. It was a serendipi...
- Wed Feb 17, 2021 12:10 pm
- Forum: Technical
- Topic: String with 0/1 representation of binary to convert
- Replies: 14
- Views: 1339
Re: String with 0/1 representation of binary to convert
Greatly appreciated. The #include <string> was missing. At that point, all seems well. I really do appreciate the input from this site. I try to utilize the help choices, plus our friend Google, but I tend to search differently than the way they think. It's often quite difficult to locate proper ref...
- Tue Feb 16, 2021 9:42 pm
- Forum: Technical
- Topic: Filtering keystrokes using FMX
- Replies: 6
- Views: 196
Re: Filtering keystrokes using FMX
Quick follow-up: Thanks for the pointers - it did (sort of)work. Eventually realized that I also needed to finish it of by changing " Key = L'\0' " to "KeyChar = L'\0' ". One problem, this works fine on Windows. The same code, same compiler, same session, but with the target switched to Android - it...
- Tue Feb 16, 2021 7:09 pm
- Forum: Technical
- Topic: Filtering keystrokes using FMX
- Replies: 6
- Views: 196
Re: Filtering keystrokes using FMX
Thanks for the info - great help. (By the way, Yes, I know Key = Key is redundant and not doing anything, but in this case it's helping me track where I am & what's going on. Does not affect the compiler, but it really works to help the human.) It's taking some getting used to, trying to decipher th...
- Tue Feb 16, 2021 7:02 pm
- Forum: Technical
- Topic: String with 0/1 representation of binary to convert
- Replies: 14
- Views: 1339
Re: String with 0/1 representation of binary to convert
This is the code block in question: do { ModNum = DivNum%8; StrOut = std::to_wstring(ModNum); // This line errors under Windows10 only Bufr[CountOct] =StrOut[0]; CountOct--; DivNum = DivNum/8; }while (DivNum>=8); it compiles and runs properly using FMX when the target OS is Android. The same code th...
- Tue Feb 16, 2021 11:18 am
- Forum: Technical
- Topic: Filtering keystrokes using FMX
- Replies: 6
- Views: 196
Filtering keystrokes using FMX
Working on Multi-Platform programming using C++Builder 10.4 and the FMX package. UPDATE: Through quite a bit of reading I have discovered that soft-keyboards rarely create a KeyEvent (in fact, it appears to be discouraged). I need to build a series of filters for input to a TEdit box, intercepting t...
- Tue Feb 16, 2021 10:55 am
- Forum: Technical
- Topic: String with 0/1 representation of binary to convert
- Replies: 14
- Views: 1339
Re: String with 0/1 representation of binary to convert
At this point I can get my program running accurately and in like fashion on both Windows and Android. Unfortunately, I have to change about 6 lines of code between the two formats. (Using C++Builder 10.4 - as an FMX based compilation). Unfortunately the best choices - std::to_wstring() (and std::to...
- Sun Feb 14, 2021 3:03 pm
- Forum: Technical
- Topic: String with 0/1 representation of binary to convert
- Replies: 14
- Views: 1339
Re: String with 0/1 representation of binary to convert
Thanks very much. Search as I may, I never did come across anything related to BCD conversion (other than working with bit-masks - which I have been doing). Great help!
I've been using wcstol for Dec & Hex, Oct, & Bin.
This hits my searches precisely. Again, thanks very much.
I've been using wcstol for Dec & Hex, Oct, & Bin.
This hits my searches precisely. Again, thanks very much.
- Fri Feb 12, 2021 4:44 pm
- Forum: Technical
- Topic: String with 0/1 representation of binary to convert
- Replies: 14
- Views: 1339
Re: String with 0/1 representation of binary to convert
Thanks, great response. I did discover the differences between various forms of characters (16 vs 32 etc) , but as you say, the library is pretty light on support. The larger problem I've been dealing with is a relatively painless method of dealing with user input in other number bases. There's plen...
- Thu Feb 11, 2021 10:56 am
- Forum: Technical
- Topic: String with 0/1 representation of binary to convert
- Replies: 14
- Views: 1339
Re: String with 0/1 representation of binary to convert
Revisiting this. The original code that I was using seems to be fine for VCL and Windows. I'm now trying to re-work with FMX for Android. The suggested code: __int64 i1 = wcstoll(Edit1->Text.c_str(), NULL, 2); (as well as the std:: version) still errors-out. The message is: wchar.h(146): candidate f...
- Wed Jan 06, 2021 2:53 pm
- Forum: Technical
- Topic: String with 0/1 representation of binary to convert
- Replies: 14
- Views: 1339
Re: String with 0/1 representation of binary to convert
Thanks for the input, and I understand your points. The real issue here is that the user is entering a binary number in text form: "1111 0101 0011". That does not normally convert to an actual integer the represents the binary number. So far, the only thing I've found is that one conversion call. It...
- Mon Jan 04, 2021 1:02 pm
- Forum: Technical
- Topic: String with 0/1 representation of binary to convert
- Replies: 14
- Views: 1339
String with 0/1 representation of binary to convert
I'm working on a project and need to convert a Unicode string (in Edit1->Text item) that has input limited to "0" and "1", which represents a binary integer. This needs to be taken and converted to an integer (preferably Int_64, but that's not set in stone). Using: Edit1->GetTextBuf(Bin,Edit1->GetTe...
- Sun Dec 06, 2020 7:16 pm
- Forum: Technical
- Topic: wcstombs & wchar_t issues
- Replies: 2
- Views: 1237
Re: wcstombs & wchar_t issues
Thanks very much, I do appreciate the detailed response, it's quite helpful. Some additional comments, the code with the note "it's wrong" happens to come directly from the Embarcadero Help page examples. I really appreciated the note about it - gets a bit frustrating when the Examples and samples d...
- Sat Dec 05, 2020 10:24 am
- Forum: Technical
- Topic: wcstombs & wchar_t issues
- Replies: 2
- Views: 1237
wcstombs & wchar_t issues
Using C++Builder 10.4 (latest updates as of 5-Dec-2020) and attempting to use some sample code from RAD Studio Docwiki (specifically the C++ Version & not Delphi) [Environment & target: Windows 10, 32 bit target] I've run into a couple issues. The example code simply breaks. Issue 1: wcstombs, which...