The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User Defined Function Structure
#1
Hi All,
I have many user-defined functions of the form:

Function NameRectifier
Code:
Copy      Help
function str&UserLogin str&UserLastName str&UserFullName
,
if UserLogin = "jkj1";
,UserLastName= "Jones"; err ret
,UserFullName= "Jonathan K Jones"; err ret

if UserLogin = "sps45";
,UserLastName= "Smith"; err ret
,UserFullName= "Sam P Smith"; err ret    
,
if UserLogin = "";
,UserLastName= ""; err ret
,UserFullName= ""; err ret
,
if UserLogin = "";
,UserLastName= ""; err ret
,UserFullName= ""; err ret

etc, etc, going on for even up to potentially >100 entries

I use these functions to link computer names to adjacent phone numbers, ip addresses, etc and to swap technical names scraped from document metadata into common names, etc.
They work perfectly fine but I was just wondering if there was a more elegant or easier to maintain or perhaps faster-executing way to organize these.
I figure there is probably an xml answer but that may not run as fast as just having them all in a long function within QM rather than an external file. Should I be creating a multi-dimensional array? Anyway, I have learned so much about about programming style just by customizing Gintaras' and other's many examples in the Forum so I thought I might ask.

Stuart


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)