Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IsNumeric - VFP analogue?
Message
De
25/12/1999 01:43:23
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00307922
Message ID:
00308519
Vues:
40
>Ed,
>>>>
>>>>First, you can set the Format of your editbox to 9 and the Maxlength to 5 and use the same code I sent you.
>>>
>>> I read Help about Format function and haven't seen 9 as one of possible formats. I'll try anyway. But it seems to me, that editboxes don't recognize format settings. I tried ! without any effect, I tried A, and I tried combination of them with no result. Can not imagine, why?
>>>
>>>
>>>If you would look you would see that.
>>>>
>>>>Secondly, why an editbox for a 5 character value?
>>>
>>> Jim, I feel obligative to explain again my intentions here, even if I did it several times in other threads. I want to use editbox (and I designed class btcc_edit, based on it) to allow our users specify multiple choices in most convenient way. Right now I'm using this class for zipcodes and zip sections, but, of course, I can use it for any criterion, like owners (right now I use btcc_text for this - so only one choice), etc. The users may type:
>>>12345 (Enter)
>>>24567 (Enter)
>>>01235
>>>etc. and I reconstruct my criterion as INLIST(zipcode,'12345,24567,01235').
>>
>>Then you're constructing it wrong - INLIST() with this list would have to appear as:
>>
>>INLIST(ZipCode,"12345","24567","01235")
>
> Actually, I reconstructed it this way, just my posting was quick and wrong. Remember you TYPE() example? :)
>
>>This is easier to do from an array or cursor where each 5 character string is discrete; to do this with a string, you'd have to parse the string and STUFF() delimiters to make it work right.
>
> The problem with cursor is that cursor existing only within Data Session, and I used private DE here. And all this application designed only for defining user's criteria and returning it as a result, so I can not use cursors. And of course, I don't want to create tables and placed them somethere.
>

There are lots of solutions. Pass it through a parameter object as a member array. Turn the cursor into a string before returning. Turn it into a simple array you pass by ref. There's no need to do this with an editbox. Create a Scripting.Dictionary object. Pass the return of DBF() back so I can open the table in a different session. Use a session object. Send smoke signals. Whatever.

>
>>Think about this - Ken Weber, Edward Pickman, Erik Moore, Jim Booth and I all agree that there's a problem with this approach. Is it possible that we
>
>
> I'm thinking about it. I agree, that this approach is wrong for validation purposes, even if it's simple in use. But I still want to make my point, that this validation is just my own initiative and nobody expects this validation here.
>
> Again, different other approaches, which all of you advised me, had their own benefits and disadvantages. Don't think, please, that I completely ignored them. I was thinking about each of them, about hassles in implementing, etc. I can justify the reasons why it's not suitable in each particular case, if you want.
>
> Let me again describe your the purpose of this control and my intentions.
> I want to provide a simple control for user's criterion. My manager told about editbox from the beginning. We want:
>749274
>7689275
>oufwi9eu
>
>Each line per value. This editbox I consider not only for zipcodes, it's just one instance of this class. I may also use it for name searching, like:
>Pickman
>Moore
>Rauh
>Booth,
>etc.
>
> Now you advise me to use grid for this. But grid requires Add/Remove buttons, which I'm trying to avoid. Besides all other problems.
>
>
>might have some idea about this? I'll admit that I have clients that pay me not to design their UIs, but I do deal with lists of Postal Codes all the time - I do shipping and logistics stuff. The others don't have end-users threatening to shoot them when the first cut of a form is delivered.
>>
>>To be honest, your btcc class should not care what control produced the list - if it really has to be an editbox, then there's a coupling problem that should be untangled - anything that can produce a character string with the list of values should work in place of an editbox. In fact, you want to store and save the string, or at least at one point indicated that you did. I'd defer to Jim on this - he's very good at explaining the concept of abstracting an interface and tight vs loose coupling - he's done some outstanding sessions at DevCons and the like in the past.
>
>Ok, explain me in details, what I should do. I'll consider...
>

I've described in outline at least one approach that I use. I don't think that my continuing this can help. Maybe you can get Jim to look at this; his explanation of how classes and interfaces should work is infinitely better than mine. I don't want to argue, and frankly, I think you desperately need someone who can get this concept across to you better than I can. I described the approach I'd take. It's not compatible with what you'd like to do.

>
> Ok, even now, when application works fine, I'm open. But, please, advise something really simple, that would not require too much trouble in implementing...

I hate to be mercenary, but...if you need a consultant, send me the code, tell me what it needs to do, and pay my hourly rate. I'll be happy to deal with it in detail then.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform