Re: String in Memofeld suchen

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Henry Habermacher [MVP Access] (DontSpamHenry_at_psp-online.com)
Date: 06/09/04


Date: Thu, 10 Jun 2004 00:00:50 +0700

Hallo Michael

Michael Zimmermann wrote in news:2iotc0Fp2c3sU1@uni-berlin.de:

> Dim Ergebnis as Variant 'Für Dich, Henry ;-)

Irgendwie fehlt Dir da was, befürchte ich. Es gibt einen Variant ohne
Subtype, den deklarierst Du hier, und dann gibt es Funktionen, die geben
einen Variant mit einem Subtype z.B. String zurück. Dieser Variant vom
Subtype String ist genau so stark typisiert, wie ein String selber. Aber
hier scheinst Du wirklich bei der Vorlesung über Datentypen geschlafen
zu haben ;-)

> Dim s as StringInTextKleisterInMemofeldFinder
>
> Set s = New StringInTextKleisterInMemofeldFinder
> s.Suchstring = "Hallo"
> s.SuchDenMist vbJetzt Or vbSofort
> Ergebnis = s.HabsGefunden
> Set s = Nothing

Kurz ist er, schon der Code, aber ist er wirklich kürzer als:

Ergebnis = suchDenMist("Hallo", vbJetzt Or vbSofort)

Ich könnte ja auch mein Standardmodul einfach
StringInTextKleinsterInMemofeldFinder nennen, dann könnte ich nämlich
sogar:

Ergebnis = StringInTextKleinsterInMemofeldFinder.SuchDenMist("Hallo",
vbJetzt Or vbSofort)

schreiben, damit's fast so kompliziert aussieht, wie der Klassenaufruf
im einfachsten Fall ;-)

Es gibt eben Leute, die werden für die Effektivität und Produktivität
bezahlt und dann wieder solche, die bekommen's für die Kreativität,
Modernität, Kompliziertheit und je Zeile Code ausbezahlt. Scheinbar
gehöre ich zu der ersten Sorte, vermutlich zwangsweise, weil jede Zeile
Code bei einer übertragungsdistanz von knapp 100'000 km eben etwas mehr
kostet :-O. bereits das Dritte mal, dass ich heute mit einem schlagenden
Argument konfrontiert wurde, wieder nach Zentral Europa zurückzusieden
und mitten drin, aber nicht in einem EU-Staat Wohnsitz zu nehmen.

Gruss aus Phuket
Henry

-- 
Keine E-Mails auf Postings in NGs senden!
Don't send e-mails to postings in newsgroups!
KB:  http://support.microsoft.com/default.aspx
FAQ: http://www.donkarl.com/AccessFAQ.htm
OH:  Online Hilfe von Microsoft Access (Taste F1)
Downloads: http://www.dbdev.org


Relevant Pages

  • Re: String in Memofeld suchen
    ... >> Es gibt einen Variant ohne Subtype ... eben Textfelder von der Datenbank vom Type Variant Subtype vbString. ... bleibt da der String "1" ...
    (microsoft.public.de.access)
  • Re: Code to delete/unlink Linked tables
    ... Public intLinkODBCTables As Variant, intLinkDB2Tables As Variant ... Public strLinkBackendDB As String, strLinkDSNname As String, strLinkLibName ... ' MsgBox "This database is in MDE format...I will delete/recreate ODBC ... Public Sub fncLinkDB2Table() ...
    (microsoft.public.access.modulesdaovba)
  • Re: OPENFILENAME A P I. User cancels ?
    ... The variable FName will be a Boolean False if no file was selected or a String containing the fully qualified file name if the user selectes a file. ... Const ahtOFN_OVERWRITEPROMPT = &H2 ... Function GetOpenFile(Optional varDirectory As Variant, ... Dim strFilter As String ...
    (microsoft.public.excel.programming)
  • RE: multi-select file dialog
    ... strCustomFilter As String ... Global Const ahtOFN_OVERWRITEPROMPT = &H2 ... Dim strFilter As String ... Function GetOpenFile(Optional varDirectory As Variant, ...
    (microsoft.public.access.modulesdaovba)
  • Re: Replace space in text file
    ... In four of the above cases you have specified which type of variable you want VB to create (Integer, Long, String or whatever). ... in the case of vChars you have not specified the required variable type and VB will therefore create it as a Variant. ... For example, if vChars was an Integer then VB would read two bytes from the file, and if it was a Long it would read four bytes, and if it was a standard variable length String which currently contained nine characters then it would read nine characters from the file and if it was a String that currently contained just one character then it would read one character from the file. ...
    (microsoft.public.vb.general.discussion)