﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Issues  » Non-AppFrame Question</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 09 May 2026 12:54:22 GMT</lastBuildDate><ttl>20</ttl><item><title>Non-AppFrame Question</title><link>http://forum.strataframe.net/FindPost6261.aspx</link><description>Also, since I am new to VB.NET and coming from Clarion, is there a way to check a single field for specific values instead of a long IF statement or Select...Case?&lt;/P&gt;&lt;P&gt;Example in Clarion:&lt;/P&gt;&lt;P&gt;IF INLIST(MyField, "Male", "Female", "Both")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MESSAGE("Valid")&lt;BR&gt;ELSE&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MESSAGE("INVALID")&lt;BR&gt;END&lt;/P&gt;&lt;P&gt;In Clarion I could test for multiple values with a single statement as shown above (I believe up to 25 values at a time).&amp;nbsp; Is there a similar statement in VB.NET?&amp;nbsp; Currently I have code like:&lt;/P&gt;&lt;P&gt;IF MyField &amp;lt;&amp;gt; "Male" AND MyField &amp;lt;&amp;gt; "Female" AND MyField &amp;lt;&amp;gt; "Both"&lt;BR&gt;...&lt;BR&gt;END&lt;/P&gt;&lt;P&gt;Thank you for any ideas!&lt;/P&gt;&lt;P&gt;Ben</description><pubDate>Mon, 29 Jan 2007 11:08:42 GMT</pubDate><dc:creator>Ben Kim</dc:creator></item><item><title>RE: Non-AppFrame Question</title><link>http://forum.strataframe.net/FindPost6397.aspx</link><description>Also...&lt;/P&gt;&lt;P&gt;In the BeforeSave event method, I cannot for the life of me figure out what the code should be to fire each control's validate method.&amp;nbsp; Here is where I am:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; lcItem &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; Control&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;For&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Each&lt;/FONT&gt;&lt;FONT size=2&gt; lcItem &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;In&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.Controls&lt;BR&gt;lcItem.?????&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Next&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;Can you guide me the rest of the way?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;Thanks!&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Mon, 29 Jan 2007 11:08:42 GMT</pubDate><dc:creator>Ben Kim</dc:creator></item><item><title>RE: Non-AppFrame Question</title><link>http://forum.strataframe.net/FindPost6395.aspx</link><description>Yes.&amp;nbsp; You can also do it inline.&lt;/P&gt;&lt;P&gt;[codesnippet]For Each lcItem As String IN TestItems&lt;BR&gt;Next[/codesnippet]&lt;/P&gt;&lt;P&gt;Either case will work.&amp;nbsp; Steve's example is also a very good idea as well if you don't need to do any internal processing.&amp;nbsp; The only problem with using the IndexOf may be case-sensitivity.&amp;nbsp; Otherwise it is definitely the quickest route.</description><pubDate>Mon, 29 Jan 2007 10:52:48 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Non-AppFrame Question</title><link>http://forum.strataframe.net/FindPost6394.aspx</link><description>Would I just Dim lcItem per your example as follows?&lt;/P&gt;&lt;P&gt;Dim lcItem As String&lt;/P&gt;&lt;P&gt;Sorry for the newbie questions!&lt;/P&gt;&lt;P&gt;Ben</description><pubDate>Mon, 29 Jan 2007 10:49:56 GMT</pubDate><dc:creator>Ben Kim</dc:creator></item><item><title>RE: Non-AppFrame Question</title><link>http://forum.strataframe.net/FindPost6391.aspx</link><description>Ben another version:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;BR&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;summary&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;''' Accepts an expression and a list of values.&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;example&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;''' Inlist("FULL", "FULL", "ACCD", "CIT", "PARK", "FI") ' Returns true&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;''' InList(456, 23, 456, 44, 357) ' Returns true&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;/example&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;/summary&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;param name="Expression"&amp;gt;&amp;lt;/param&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;param name="Items"&amp;gt;&amp;lt;/param&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Shared&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/FONT&gt;&lt;FONT size=2&gt; InList(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; Expression &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Object&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ParamArray&lt;/FONT&gt;&lt;FONT size=2&gt; Items() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Object&lt;/FONT&gt;&lt;FONT size=2&gt;) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Boolean&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return&lt;/FONT&gt;&lt;FONT size=2&gt; Array.IndexOf(Items, Expression) &amp;gt; -1&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;BR&gt;&lt;/FONT&gt;[/codesnippet]</description><pubDate>Mon, 29 Jan 2007 10:37:40 GMT</pubDate><dc:creator>Steve L. Taylor</dc:creator></item><item><title>RE: Non-AppFrame Question</title><link>http://forum.strataframe.net/FindPost6387.aspx</link><description>It looks great.&amp;nbsp; The only suggestion I would make would be to replace the LBound and UBound functions as these are left in at the moment for backward compatability.&amp;nbsp; The array has all of this information already within it.&amp;nbsp; &lt;/P&gt;&lt;P&gt;[codesnippet]For Each lcItem In TestItems&lt;BR&gt;Next[/codesnippet]&lt;/P&gt;&lt;P&gt;or&lt;BR&gt;&lt;BR&gt;[codesnippet]For lnIndex = 0 To TestItems.Length-1&lt;BR&gt;Next[/codesnippet]&lt;/P&gt;&lt;P&gt;Otherwise I think it looks great!&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Mon, 29 Jan 2007 09:58:51 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Non-AppFrame Question</title><link>http://forum.strataframe.net/FindPost6370.aspx</link><description>Trent,&lt;/P&gt;&lt;P&gt;Thank you for your help.&amp;nbsp; I implemented the function in a common "module.vb" file and it works like a treat.&amp;nbsp; Here is the code if anyone else wants to implement the feature:&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;[code]&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;P&gt;Module&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; CommonTools&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/FONT&gt;&lt;FONT size=2&gt; InList(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; TestValue &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ParamArray&lt;/FONT&gt;&lt;FONT size=2&gt; TestItems() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Boolean&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; lLoop &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Integer&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; lResult &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Boolean&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;lResult = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;False&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;For&lt;/FONT&gt;&lt;FONT size=2&gt; lLoop = LBound(TestItems) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;To&lt;/FONT&gt;&lt;FONT size=2&gt; UBound(TestItems)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; TestValue.Trim = TestItems(lLoop).Trim &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;lResult = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;True&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Exit&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;For&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Next&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Return&lt;/FONT&gt;&lt;FONT size=2&gt; lResult&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/P&gt;&lt;P&gt;End&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Module&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;[/code]&lt;/P&gt;&lt;P&gt;Here is an example on how to use the InList function:&lt;/P&gt;&lt;P&gt;[code]&lt;BR&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Not&lt;/FONT&gt;&lt;FONT size=2&gt; InList(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.EventType, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"FULL"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"ACCD"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"CIT"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"PARK"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"FI"&lt;/FONT&gt;&lt;FONT size=2&gt;) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me&lt;/FONT&gt;&lt;FONT size=2&gt;.AddBrokenRule(IncdTypeBOFieldNames.PathOf, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"Please choose a event type."&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;BR&gt;[/code]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;Ben&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Mon, 29 Jan 2007 09:17:53 GMT</pubDate><dc:creator>Ben Kim</dc:creator></item><item><title>RE: Non-AppFrame Question</title><link>http://forum.strataframe.net/FindPost6317.aspx</link><description>No fun.&amp;nbsp; You could easily create this type of functionality by creating a shared class and a collection.&lt;/P&gt;&lt;P&gt;[codesnippet]Public Sub NotInheritable MyCommonTools&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Shared Function InList(ByVal TestValue as String, ParamArray TestItems() As String) As Boolean&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Cycle through and test the values here and return out&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;BR&gt;End Sub[/codesnippet]</description><pubDate>Fri, 26 Jan 2007 15:15:34 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Non-AppFrame Question</title><link>http://forum.strataframe.net/FindPost6316.aspx</link><description>Thanks Trent.&amp;nbsp; Unfortunately we have to support a legacy database that cannot be changed.&lt;/P&gt;&lt;P&gt;Ben</description><pubDate>Fri, 26 Jan 2007 14:15:30 GMT</pubDate><dc:creator>Ben Kim</dc:creator></item><item><title>RE: Non-AppFrame Question</title><link>http://forum.strataframe.net/FindPost6276.aspx</link><description>There is not an INLIST method in VB.NET.&amp;nbsp; Generally when I have a situation like this, I would not use a String field.&amp;nbsp; This would be a integer field then I would create an Enum for each of the values.&amp;nbsp; You can then do a bitwise test depending upon how you create the enum.&amp;nbsp;</description><pubDate>Thu, 25 Jan 2007 18:27:05 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Non-AppFrame Question</title><link>http://forum.strataframe.net/FindPost6263.aspx</link><description>Ben,&lt;br&gt;
&lt;br&gt;
Did you know there was a general .NET forum here?  Click on the home link (under your name above the Add Post, Reply buttons) and down at the bottom you'll see a .NET forum. Its just for this sort of thing.  The SF developers don't care much were you post it, as they get emails for new posts (based on what Ben Chase has said), but for us normal uses, it helps :hehe:&lt;br&gt;
&lt;br&gt;
I'm really curious to know if this can happen in VB.NET, BTW  :D</description><pubDate>Thu, 25 Jan 2007 17:39:47 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>